[autocomplete] allow keyboard to override an idle mouse
This commit is contained in:
parent
ef5f1f8599
commit
0e887175e0
1 changed files with 8 additions and 2 deletions
|
@ -101,8 +101,14 @@ function renderCompletions(element) {
|
|||
li.className = 'selected';
|
||||
}
|
||||
// on hover, select the completion
|
||||
li.addEventListener('mouseover', () => {
|
||||
highlightCompletion(element, i);
|
||||
// (use mousemove rather than mouseover, because
|
||||
// if the mouse is stationary, then we want the
|
||||
// keyboard to be able to override it)
|
||||
li.addEventListener('mousemove', () => {
|
||||
// avoid re-rendering if the completion is already selected
|
||||
if(element.selected_completion !== i) {
|
||||
highlightCompletion(element, i);
|
||||
}
|
||||
});
|
||||
// on click, set the completion
|
||||
// (mousedown is used instead of click because click is
|
||||
|
|
Reference in a new issue