Reputation: 1074
If you write <input type="search">
in HTML5, the keyboard of the input in safari on iOS is as follows.
Submit button is "search".
By the way, I am trying to create a search form in Nuxt.js as well and mark it up in component as below.
<div class="search-form">
<form
@submit.prevent
@keyup="onKey($event)">
<input
v-model="keyword"
:placeholder="search form"
type="search"
@keypress="setCanMessageSubmit($event)">
</form>
</div>
However, the keyboard shows "return" instead of "search" as shown below.
Why is this?
Is there a way to solve it?
Upvotes: 0
Views: 1210
Reputation: 969
Try adding action
attribute to your form
tag.
<div class="search-form">
<form
action="."
@submit.prevent
@keyup="onKey($event)">
<input
v-model="keyword"
:placeholder="search form"
type="search"
@keypress="setCanMessageSubmit($event)">
</form>
</div>
My fiddle: https://jsfiddle.net/pompopo/2b0yc6oq/7/
Upvotes: 1