recent_topics: Fix partially hidden row sometimes in recent topics.

The top row of the RT can be hidden sometimes after scrolling down
and then scrolling up. This is because the focus is applied before
the row is rendered. Applying the focus after the topic row is
rendered by the browser makes sure it is always visisble when
it needs to be.
This commit is contained in:
Aman Agrawal 2020-09-24 22:13:32 +05:30 committed by Tim Abbott
parent 5fc51d0a4d
commit 5d4217ffc9
1 changed files with 4 additions and 1 deletions

View File

@ -66,7 +66,10 @@ function set_table_focus(row, col) {
return true;
}
// Setting focus after the render is complete doesn't partially hide the row from view.
setTimeout(() => {
topic_rows.eq(row).find(".recent_topics_focusable").eq(col).children().trigger("focus");
}, 0);
current_focus_elem = "table";
return true;
}