mirror of https://github.com/zulip/zulip.git
minor: Use Array.includes instead of a regex to check for values.
This commit is contained in:
parent
94a22f9323
commit
cee94654df
|
@ -130,7 +130,8 @@ export const DropdownListWidget = function ({
|
|||
|
||||
search_input.on("keydown", (e) => {
|
||||
const {key, keyCode, which} = e;
|
||||
if (!/(ArrowUp|ArrowDown|Escape)/.test(key)) {
|
||||
const navigation_keys = ["ArrowUp", "ArrowDown", "Escape"];
|
||||
if (!navigation_keys.includes(key)) {
|
||||
return;
|
||||
}
|
||||
e.preventDefault();
|
||||
|
|
Loading…
Reference in New Issue