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.

list_util: Narrow event type to `JQuery.KeyDownEvent` only.

Prakhar Pratyush4e43c2f32d0c
diff --git a/web/src/list_util.ts b/web/src/list_util.ts
index 4fb4bb8a06b..4408af8b2d8 100644
--- a/web/src/list_util.ts
+++ b/web/src/list_util.ts
@@ -9,18 +9,18 @@ const list_selectors = [
"#send_later_options",
];
-export function inside_list(e: JQuery.KeyDownEvent | JQuery.KeyPressEvent): boolean {
+export function inside_list(e: JQuery.KeyDownEvent): boolean {
const $target = $(e.target);
const in_list = $target.closest(list_selectors.join(", ")).length > 0;
return in_list;
}
-export function go_down(e: JQuery.KeyDownEvent | JQuery.KeyPressEvent): void {
+export function go_down(e: JQuery.KeyDownEvent): void {
const $target = $(e.target);
$target.closest("li").next().find("a").trigger("focus");
}
-export function go_up(e: JQuery.KeyDownEvent | JQuery.KeyPressEvent): void {
+export function go_up(e: JQuery.KeyDownEvent): void {
const $target = $(e.target);
$target.closest("li").prev().find("a").trigger("focus");
}