Fixed bug where Enter read from hidden dropdown.

This commit is contained in:
Christian Bastian
2024-03-31 05:00:49 -04:00
parent 4051444c11
commit a15ec0006e

View File

@@ -990,7 +990,8 @@ class DirectoryDropdown {
} }
else if (e.key === "Enter") { else if (e.key === "Enter") {
e.stopPropagation(); e.stopPropagation();
const input = e.target const input = e.target;
if (dropdown.style.display !== "none") {
const selection = options[iSelection]; const selection = options[iSelection];
if (selection !== undefined && selection !== null) { if (selection !== undefined && selection !== null) {
DirectoryDropdown.selectionToInput( DirectoryDropdown.selectionToInput(
@@ -1005,6 +1006,7 @@ class DirectoryDropdown {
} }
updateCallback(); updateCallback();
} }
}
await submitCallback(); await submitCallback();
input.blur(); input.blur();
} }