From 03ea1ce528634a09e2b7fb53e69405dcc81db150 Mon Sep 17 00:00:00 2001 From: Aman Agrawal Date: Sun, 15 Oct 2023 08:54:13 +0000 Subject: [PATCH] recent_view_ui: Fix quick multiple page downs resulting in errors. Fixes #27209 Since post_scroll__pre_render_callback is called to set the correct focus, we don't need to set focus again here. This was happening because `set_table_focus` relies on rows being already rendered in the DOM which is not the case with page down since rows are still being rendered by list widget as we scroll down. This code was the source of the error: ``` if (new_scrollTop >= table_height) { row_focus = topics_widget.get_current_list().length - 1; } ``` row_focus set here is not rendered yet, hence making set focus on search box. But, since we set focus on table if user is scrolling, this sets focus back on the table. --- web/src/recent_view_ui.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/web/src/recent_view_ui.js b/web/src/recent_view_ui.js index 372532d69c..57a720d8c5 100644 --- a/web/src/recent_view_ui.js +++ b/web/src/recent_view_ui.js @@ -1116,7 +1116,6 @@ function page_up_navigation() { row_focus = 0; } $scroll_container.scrollTop(new_scrollTop); - set_table_focus(row_focus, col_focus); } function page_down_navigation() { @@ -1130,7 +1129,6 @@ function page_down_navigation() { row_focus = topics_widget.get_current_list().length - 1; } $scroll_container.scrollTop(new_scrollTop); - set_table_focus(row_focus, col_focus); } function check_row_type_transition(row, col) {