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.

inbox: Don't changed focused element on the first user keypress.

Aman Agrawal04f7dd998b3d
diff --git a/web/src/inbox_ui.ts b/web/src/inbox_ui.ts
index 6271d8f6f82..1c69a5bb262 100644
--- a/web/src/inbox_ui.ts
+++ b/web/src/inbox_ui.ts
@@ -1621,8 +1621,16 @@ function page_down_navigation(): void {
}
export function change_focused_element(input_key: string): boolean {
- // Start showing visible focus outlines.
- $("#inbox-view").removeClass("no-visible-focus-outlines");
+ const is_first_user_keypress = $("#inbox-view").hasClass("no-visible-focus-outlines");
+ if (is_first_user_keypress) {
+ // Start showing visible focus outlines.
+ $("#inbox-view").removeClass("no-visible-focus-outlines");
+ }
+ const skip_keyboard_navigation = is_first_user_keypress && !is_search_focused();
+ if (skip_keyboard_navigation) {
+ return true;
+ }
+
if (input_key === "tab" || input_key === "shift_tab") {
// Tabbing should be handled by browser but to keep the focus element same
// when we rerender or user uses other hotkeys, we need to track