[autocomplete] don't lose focus after selecting a completion

This commit is contained in:
Shish 2023-12-26 03:40:30 +00:00
parent 574087ffdb
commit 33adf9aeff

View file

@ -101,8 +101,9 @@ function renderCompletions(element) {
// (mousedown is used instead of click because click is
// fired after blur, which causes the completion block to
// be removed before the click event is handled)
li.addEventListener('mousedown', () => {
li.addEventListener('mousedown', (event) => {
setCompletion(element, key);
event.preventDefault();
});
completions_el.appendChild(li);
});