Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

minor: Use Array.includes instead of a regex to check for values.

Priyank Patelcee94654df81
diff --git a/static/js/dropdown_list_widget.js b/static/js/dropdown_list_widget.js
index 12d335e547d..adf3d550948 100644
--- a/static/js/dropdown_list_widget.js
+++ b/static/js/dropdown_list_widget.js
@@ -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();