popovers: Fix selected message being changed on scroll inside popover.

Since scroll event is always fired at root level, we don't have
control over capturing the event and containing it to the popover
if scroll happened inside the popover.

This can lead to unintentional moving of selected message since
we try to move the selected message to rendered top / bottom if
we receive a scroll event when top / bottom ends are rendered.
This commit is contained in:
Aman Agrawal 2024-05-31 08:15:02 +00:00 committed by Tim Abbott
parent ddf14116b2
commit 0468f609e8
1 changed files with 1 additions and 0 deletions

View File

@ -222,6 +222,7 @@ export function initialize_kitchen_sink_stuff() {
message_viewport.$scroll_container.on("wheel", (e) => {
const delta = e.originalEvent.deltaY;
if (
!popovers.any_active() &&
!overlays.any_active() &&
!modals.any_active() &&
narrow_state.is_message_feed_visible()