Skip to content

Commit

Permalink
avoid searchbar shadow on goHome()
Browse files Browse the repository at this point in the history
  • Loading branch information
dmstern committed Nov 26, 2018
1 parent 617f7cf commit f2ce1a7
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -249,22 +249,26 @@ 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();
}
this.clearSearchBar();
this.$refs.searchbar.selectedItems.push(...args.filters);
}
});
}
private clearSearchBar() : void {
while (this.$refs.searchbar.selectedItems.length > 0) {
this.$refs.searchbar.selectedItems.pop();
}
}
private get searchInput(): HTMLInputElement {
return this.$refs.searchbar.$el.querySelector('input');
}
private goHome(): void {
router.push('/');
this.$refs.searchbar.reset();
this.clearSearchBar();
}
private loadPackages(): void {
Expand Down

0 comments on commit f2ce1a7

Please sign in to comment.