Answer the question
In order to leave comments, you need to log in
Focus ul li, how to make ul li respond to the up down keys on the keyboard?
After reading the documentation, it was not possible to implement the plan.
The problem is that after the user enters a search query, it is likely that he will press the down button to go to the list and navigate already on the keyboard.
Something like Google, enter a search query and immediately press down.
Here is my frame
<template>
<div class="input-group input-group-lg">
<input type="search"
class="form-control"
placeholder="Поиск компаний"
v-model="search_value"
v-on:input="ChangeInput"
autocomplete="off"
>
<div class="result-search" v-if="items.length > 0 && search_value" tabindex="0">
<ul @keydown="keydown" tabindex="1">
<li v-for="(item, index) in items" @click="Select(item)" tabindex="-1">{{item.name}}</li>
</ul>
</div>
</div>
</template>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question