Skip to content

Commit

Permalink
Merge pull request #247 from animena/main
Browse files Browse the repository at this point in the history
firing on-change event when item is removed
  • Loading branch information
jahaganiev authored Apr 3, 2024
2 parents a691c77 + 5edee4a commit fc26fa5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/plugins/select/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ class HSSelect extends HSBasePlugin<ISelectOptions> implements ISelect {
this.unselectMultipleItems();
this.setTagsItems();
this.selectMultipleItems();
this.fireEvent('change', this.value);
});

this.tagsItems.append(newItem);
Expand Down Expand Up @@ -363,8 +364,10 @@ class HSSelect extends HSBasePlugin<ISelectOptions> implements ISelect {

private buildTagsInput() {
this.tagsInput = document.createElement('input');
(this.tagsInput as HTMLInputElement).placeholder = this.placeholder;

if (!this.value.length)
(this.tagsInput as HTMLInputElement).placeholder = this.placeholder;

if (this.tagsInputClasses)
classToClassList(this.tagsInputClasses, this.tagsInput);

Expand Down

0 comments on commit fc26fa5

Please sign in to comment.