Skip to content

Commit

Permalink
fix($plugin-search): ignore Enter key when converting text (fix vuejs…
Browse files Browse the repository at this point in the history
  • Loading branch information
piyoppi committed May 12, 2021
1 parent 38e9863 commit 346d896
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions packages/@vuepress/plugin-search/SearchBox.vue
@@ -1,20 +1,21 @@
<template>
<div class="search-box">
<input
ref="input"
aria-label="Search"
:value="query"
:class="{ 'focused': focused }"
:placeholder="placeholder"
autocomplete="off"
spellcheck="false"
@input="query = $event.target.value"
@focus="focused = true"
@blur="focused = false"
@keyup.enter="go(focusIndex)"
@keyup.up="onUp"
@keyup.down="onDown"
>
<form @submit.prevent="go(focusIndex)">
<input
ref="input"
aria-label="Search"
:value="query"
:class="{ 'focused': focused }"
:placeholder="placeholder"
autocomplete="off"
spellcheck="false"
@input="query = $event.target.value"
@focus="focused = true"
@blur="focused = false"
@keyup.up="onUp"
@keyup.down="onDown"
>
</form>
<ul
v-if="showSuggestions"
class="suggestions"
Expand Down

0 comments on commit 346d896

Please sign in to comment.