Fixed bug where Enter read from hidden dropdown.
This commit is contained in:
@@ -990,20 +990,22 @@ class DirectoryDropdown {
|
|||||||
}
|
}
|
||||||
else if (e.key === "Enter") {
|
else if (e.key === "Enter") {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
const input = e.target
|
const input = e.target;
|
||||||
const selection = options[iSelection];
|
if (dropdown.style.display !== "none") {
|
||||||
if (selection !== undefined && selection !== null) {
|
const selection = options[iSelection];
|
||||||
DirectoryDropdown.selectionToInput(
|
if (selection !== undefined && selection !== null) {
|
||||||
input,
|
DirectoryDropdown.selectionToInput(
|
||||||
selection,
|
input,
|
||||||
modelData.searchSeparator,
|
selection,
|
||||||
DROPDOWN_DIRECTORY_SELECTION_KEY_CLASS
|
modelData.searchSeparator,
|
||||||
);
|
DROPDOWN_DIRECTORY_SELECTION_KEY_CLASS
|
||||||
const path = this.#updateOptions();
|
);
|
||||||
if (path !== undefined) {
|
const path = this.#updateOptions();
|
||||||
this.#updateDeepestPath(path);
|
if (path !== undefined) {
|
||||||
|
this.#updateDeepestPath(path);
|
||||||
|
}
|
||||||
|
updateCallback();
|
||||||
}
|
}
|
||||||
updateCallback();
|
|
||||||
}
|
}
|
||||||
await submitCallback();
|
await submitCallback();
|
||||||
input.blur();
|
input.blur();
|
||||||
|
|||||||
Reference in New Issue
Block a user