summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny S <me@ch1p.io>2021-04-08 01:50:43 +0300
committerGitHub <noreply@github.com>2021-04-08 01:50:43 +0300
commit147d3a70ea40389d3630e4146628ca0821d7ba74 (patch)
tree9371845524f77d39ff68813401288f547c95e45e
parent88f097308734bd79ca911aab52a55bc2bba82331 (diff)
parent67c49775fd4920d35613f2063b1acec9331a1370 (diff)
Merge pull request #3 from CBke/arrowdownkey
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 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;
+ }
});
}