Skip to content

Commit 89f26c6

Browse files
committed
fix($plugin-search): ignore enter input during character conversion
1 parent 38e9863 commit 89f26c6

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

packages/@vuepress/plugin-search/SearchBox.vue

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
<template>
22
<div class="search-box">
3-
<input
4-
ref="input"
5-
aria-label="Search"
6-
:value="query"
7-
:class="{ 'focused': focused }"
8-
:placeholder="placeholder"
9-
autocomplete="off"
10-
spellcheck="false"
11-
@input="query = $event.target.value"
12-
@focus="focused = true"
13-
@blur="focused = false"
14-
@keyup.enter="go(focusIndex)"
15-
@keyup.up="onUp"
16-
@keyup.down="onDown"
17-
>
3+
<form @submit.prevent="go(focusIndex)">
4+
<input
5+
ref="input"
6+
aria-label="Search"
7+
:value="query"
8+
:class="{ 'focused': focused }"
9+
:placeholder="placeholder"
10+
autocomplete="off"
11+
spellcheck="false"
12+
@input="query = $event.target.value"
13+
@focus="focused = true"
14+
@blur="focused = false"
15+
@keyup.up="onUp"
16+
@keyup.down="onDown"
17+
>
18+
</form>
1819
<ul
1920
v-if="showSuggestions"
2021
class="suggestions"

0 commit comments

Comments
 (0)