Skip to content

Commit

Permalink
Merge pull request #3968 from kodadot/main
Browse files Browse the repository at this point in the history
  • Loading branch information
petersopko authored Sep 15, 2022
2 parents a095ec8 + bc89525 commit a3f8b3e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ export default class NavbarMenu extends mixins(PrefixMixin, AuthMixin) {
}
showMobileSearchBar() {
this.mobilSearchRef.focusInput()
this.mobilSearchRef?.focusInput()
}
closeBurgerMenu() {
Expand Down
8 changes: 7 additions & 1 deletion components/search/Search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<slot name="next-filter"></slot>
<SearchBarInput
v-if="!hideSearchInput"
ref="searchRef"
v-model="name"
:query="query"
@enter="nativeSearch"
Expand Down Expand Up @@ -71,7 +72,7 @@
</template>

<script lang="ts">
import { Component, Emit, Prop, mixins } from 'nuxt-property-decorator'
import { Component, Emit, Prop, Ref, mixins } from 'nuxt-property-decorator'
import { Debounce } from 'vue-debounce-decorator'
import { exist, existArray } from './exist'
import { SearchQuery } from './types'
Expand Down Expand Up @@ -104,6 +105,7 @@ export default class Search extends mixins(
@Prop({ type: Boolean, default: false }) public listed!: boolean
@Prop(Boolean) public hideFilter!: boolean
@Prop(Boolean) public hideSearchInput!: boolean
@Ref('searchRef') readonly searchRef
public isVisible = false
public query: SearchQuery = {
search: this.$route.query?.search?.toString() ?? '',
Expand Down Expand Up @@ -261,6 +263,10 @@ export default class Search extends mixins(
this.updateSearch(this.name)
}
public focusInput(): void {
this.searchRef?.focusInput()
}
@Debounce(100)
replaceUrl(queryCondition: { [key: string]: any }): void {
this.$router
Expand Down

0 comments on commit a3f8b3e

Please sign in to comment.