Skip to content
Snippets Groups Projects
Commit 81b3e5d3 authored by Robert's avatar Robert
Browse files

UPD: Use Tab to navigate suggestions

parent fda108d3
No related branches found
No related tags found
No related merge requests found
Pipeline #273663 passed with warnings
......@@ -7,6 +7,7 @@
v-model="search_input" class="mr-2 search"
@focus="search_has_focus = true"
@blur="searchLostFocus"
@keydown.tab="searchKeyboardTab($event)"
@keydown.down="searchKeyboardSelect($event,true)"
@keydown.up="searchKeyboardSelect($event,false)"
@keydown.enter="searchKeyboardSubmit($event)"
......@@ -179,6 +180,11 @@ export default {
this.keyboard_focus = Math.min(Math.max(this.keyboard_focus, -1), this.suggestions.length - 1);
}
},
searchKeyboardTab(e) {
if (this.keyboard_focus < this.suggestions.length - 1) {
this.searchKeyboardSelect(e, true)
}
},
searchKeyboardSubmit(e) {
if (this.keyboard_focus !== -1) {
e.preventDefault()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment