Skip to content

Commit

Permalink
Emit filter changes on filter removal
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-raadi committed Feb 23, 2023
1 parent 0434712 commit e77cc5c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/js/entry.js

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions resources/js/components/MultiselectFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export default {
data: () => ({
options: [],
isDropdownOpen: false,
hasRemoved: false,
selectedOptions: [],
isTouched: false,
}),
Expand Down Expand Up @@ -99,6 +100,11 @@ export default {
this.selectedOptions = this.isMultiselect ? value : [value];
this.$nextTick(this.repositionDropdown);
if (this.hasRemoved) {
this.hasRemoved = false;
this.emitChanges();
}
},
handleClose() {
Expand All @@ -112,10 +118,7 @@ export default {
},
handleRemove() {
// Resolve issue where handleRemove is called before handleChange
this.$nextTick(() => {
if (!this.isDropdownOpen) this.emitChanges();
});
this.hasRemoved = true;
},
emitChanges() {
Expand Down

0 comments on commit e77cc5c

Please sign in to comment.