It seems like there is an error when one uses enter to select an item in the dropdown list.
The problem is the following:
onKeyDown is called prior to onKeyPress, however, onKeyDown doe close the dropdown. Than when the execution comes to onKeyPress, the call to onEnter is not executed due to the opened flag, which was set to false by onKeyDown :
function onKeyPress(e) {
if (debug) {
console.log("onKeyPress")
}
if (e.key === "Enter" && opened) { // << == HERE
e.preventDefault()
onEnter()
}
}
Version: 2.3.2
It seems like there is an error when one uses enter to select an item in the dropdown list.
The problem is the following:
onKeyDown
is called prior toonKeyPress
, however,onKeyDown
doe close the dropdown. Than when the execution comes toonKeyPress
, the call toonEnter
is not executed due to theopened
flag, which was set to false byonKeyDown
:Fix: remove
&& opened
.Related PR: https://github.com/pstanoev/simple-svelte-autocomplete/pull/143