mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 14:35:27 +00:00
Fix issue where arrowing-down near end of page would skip a message.
We had this fascinating behavior where pressing a down arrow near the end of the page would advance the pointer, call recenter_view, which would trigger a scroll event, which would call keep_pointer_in_view, which would notice that we were at the end of the page and advance the pointer again! I split out that last part into its own function which is only called on mousewheel events. (imported from commit bc85443e762356e3055f8f88585940a1f11f9124)
This commit is contained in:
@@ -515,6 +515,16 @@ function keep_pointer_in_view() {
|
||||
}
|
||||
}
|
||||
}
|
||||
update_selected_message(next_message);
|
||||
}
|
||||
|
||||
// The idea here is when you've scrolled to the very
|
||||
// bottom of the page, e.g., the scroll handler isn't
|
||||
// going to fire anymore. But if I continue to use
|
||||
// the scrollwheel, the selection should advance until
|
||||
// I'm at the very top or the very bottom of the page.
|
||||
function move_pointer_at_page_top_and_bottom() {
|
||||
var next_message = get_message_row(selected_message_id);
|
||||
|
||||
if (at_top_of_viewport() && (parseInt(get_id(next_message), 10) >
|
||||
parseInt(get_id(get_first_visible()), 10))) {
|
||||
|
||||
Reference in New Issue
Block a user