message_list_view: Check if the sticky header is not from overlays.

When `message_row`s can be stacked on top of each other if draft
or scheduled messages overlay is open. To avoid selecting
message from them, we filter them out.
This commit is contained in:
Aman Agrawal
2025-01-23 04:10:47 +05:30
committed by Tim Abbott
parent 033c706a03
commit 753181bee9

View File

@@ -2148,7 +2148,8 @@ export class MessageListView {
);
const message_rows = elements_below_sticky_header
.filter((element) => element instanceof HTMLElement)
.filter((element) => element.classList.contains("message_row"));
.filter((element) => element.classList.contains("message_row"))
.filter((element) => !rows.is_overlay_row($(element)));
if (message_rows.length === 0) {
/* If there is no message row under the header, it means it is not sticky yet,
so we just get the message next to the header. */