From 7762e39064274cda06beac94e6c78ff0ff10b384 Mon Sep 17 00:00:00 2001 From: Daniel Morgenstern Date: Wed, 12 Sep 2018 13:25:46 +0200 Subject: [PATCH] Fix inconsistent searchbar state, do not clear searchbar on trigger-filter-search --- src/App.vue | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/App.vue b/src/App.vue index a4347a8..26e130d 100644 --- a/src/App.vue +++ b/src/App.vue @@ -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); } });