Commit 81b3e5d3 authored by gj4210's avatar gj4210 👁
Browse files

UPD: Use Tab to navigate suggestions

parent fda108d3
Pipeline #106645 passed with stages
in 10 minutes and 19 seconds
......@@ -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()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment