Skip to content

Commit

Permalink
Fix trigger search filter on click meta info (was not working properly)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmstern committed Sep 8, 2018
1 parent 337b0b0 commit 121960a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,12 @@ export default class App extends Vue {
});
EventBus.$on(Events.TRIGGER_FILTER_SEARCH, (args: { filters: Searchable[], query: string }) => {
while (this.activeFilters.length > 0) {
this.activeFilters.pop();
if (this.$refs.searchbar && this.$refs.searchbar.selectedItems) {
while (this.$refs.searchbar.selectedItems.length > 0) {
this.$refs.searchbar.selectedItems.pop();
}
this.$refs.searchbar.selectedItems.push(...args.filters);
}
this.activeFilters.push(...args.filters);
});
}
Expand All @@ -241,9 +243,7 @@ export default class App extends Vue {
private goHome() {
router.push('/');
this.$nextTick(() => {
EventBus.$emit(Events.TRIGGER_FILTER_SEARCH, { filters: [] });
});
this.$refs.searchbar.reset();
}
private loadPackages(): void {
Expand Down

0 comments on commit 121960a

Please sign in to comment.