diff options
author | Evgeny S <me@ch1p.io> | 2021-04-08 01:50:43 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-08 01:50:43 +0300 |
commit | 147d3a70ea40389d3630e4146628ca0821d7ba74 (patch) | |
tree | 9371845524f77d39ff68813401288f547c95e45e | |
parent | 88f097308734bd79ca911aab52a55bc2bba82331 (diff) | |
parent | 67c49775fd4920d35613f2063b1acec9331a1370 (diff) |
Merge pull request #3 from CBke/arrowdownkey
set focus to first suggestion by down arrow key
-rw-r--r-- | autocomplete.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/autocomplete.js b/autocomplete.js index dc95a1b..3350108 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; + } }); } |