aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe <christophe.bude@uantwerpen.be>2021-03-31 18:34:00 +0200
committerChristophe <christophe.bude@uantwerpen.be>2021-03-31 18:34:30 +0200
commit67c49775fd4920d35613f2063b1acec9331a1370 (patch)
treed225a3e2a0d82d5465aa38a13f13d05ce74b38ee
parent724ee6c6f4ebb69a3a5200cd5d29dbe54991ad91 (diff)
set focus to first suggestion by down arrow key
-rw-r--r--autocomplete.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/autocomplete.js b/autocomplete.js
index 90629a2..1d3be4a 100644
--- a/autocomplete.js
+++ b/autocomplete.js
@@ -41,6 +41,10 @@ class Autocomplete {
this.dropdown.hide();
return;
}
+ if (e.keyCode === 40) {
+ this.dropdown._menu.children[0]?.focus();
+ return;
+ }
});
}