Skip to content

Commit

Permalink
do not clear searchbar on goHome()
Browse files Browse the repository at this point in the history
  • Loading branch information
dmstern committed Nov 26, 2018
1 parent 7d9ef0b commit 7b7f644
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<v-icon>{{$vuetify.icons.menu}}</v-icon>
</v-btn>
<v-toolbar-title
@click="goHome"
@click="$router.push('/')"
class="home-button"
>
<img src="@/../art/logo.svg" alt="npmFrog" class="v-btn--icon">
Expand Down Expand Up @@ -251,35 +251,19 @@ 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) {
this.clearSearchBar();
while (this.$refs.searchbar.selectedItems.length > 0) {
this.$refs.searchbar.selectedItems.pop();
}
this.$refs.searchbar.selectedItems.push(...args.filters);
}
});
}
private clearSearchBar(): void {
while (this.$refs.searchbar.selectedItems.length > 0) {
this.$refs.searchbar.selectedItems.pop();
}
while (this.activeFilters.length > 0) {
this.activeFilters.pop();
}
this.$nextTick(() => {
this.hasFocus = false;
});
this.fireSearchFilterEvent();
}
private get searchInput(): HTMLInputElement {
return this.$refs.searchbar.$el.querySelector('input');
}
private goHome(): void {
router.push('/');
this.clearSearchBar();
}
private loadPackages(): void {
DataStore.Instance.getPackages().then((packages: Package[]) => {
this.searchItems =
Expand Down

0 comments on commit 7b7f644

Please sign in to comment.