Skip to content

Commit 11afc95

Browse files
committed
Ignore Enter key when converting text (for Japanese characters)
See vuejs/vuepress#2851
1 parent 610de90 commit 11afc95

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

components/SearchBox.vue

+16-15
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 v-if="showSuggestions" class="suggestions" :class="{ 'align-right': alignRight }" @mouseleave="unfocus">
1920
<li
2021
v-for="(s, i) in suggestions"

0 commit comments

Comments
 (0)