Skip to content

Commit

Permalink
fix: better blur behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
krmax44 committed Aug 30, 2019
1 parent c867965 commit 83261a0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/SiteSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
@keyup="query = $refs.search.value"
@keyup.esc="reset()"
@keyup.enter="goTo()"
@blur="!results && reset()"
/>

<button
Expand Down Expand Up @@ -100,6 +101,9 @@ export default {
reset() {
this.$refs.search.value = ''
this.searching = false
this.results = []
this.query = ''
this.$refs.search.blur()
},
goTo(to) {
if (!to) to = this.results[0] && this.results[0].permalink
Expand Down

0 comments on commit 83261a0

Please sign in to comment.