UX: Keep focus on input after selecting an autocomplete option

This is particularly helpful on mobile, now tapping on an item from
the autocomplete dropdown keeps the keyboard visible.
This commit is contained in:
Penar Musaraj
2020-05-27 12:40:38 -04:00
parent 68fdfd76f5
commit 7bc496070f

View File

@@ -274,6 +274,9 @@ export default function(options) {
ul.find("li").click(function() {
selectedOption = ul.find("li").index(this);
completeTerm(autocompleteOptions[selectedOption]);
if (!options.single) {
me.focus();
}
return false;
});
var pos = null;