Skip to content

Commit

Permalink
Fix inconsistent searchbar state, do not clear searchbar on trigger-f…
Browse files Browse the repository at this point in the history
…ilter-search
  • Loading branch information
dmstern committed Nov 26, 2018
1 parent 7b7f644 commit 7762e39
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,10 @@ export default class App extends Vue {
});
EventBus.$on(Events.TRIGGER_FILTER_SEARCH, (args: { filters: Searchable[], query: string }) => {
if (this.$refs.searchbar && this.$refs.searchbar.selectedItems) {
while (this.$refs.searchbar.selectedItems.length > 0) {
this.$refs.searchbar.selectedItems.pop();
if (this.$refs.searchbar) {
for (const filter of args.filters) {
this.$refs.searchbar.selectItem(filter);
}
this.$refs.searchbar.selectedItems.push(...args.filters);
}
});
Expand Down

0 comments on commit 7762e39

Please sign in to comment.