diff --git a/.changeset/honest-mails-try.md b/.changeset/honest-mails-try.md new file mode 100644 index 000000000000..23af3a246af0 --- /dev/null +++ b/.changeset/honest-mails-try.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +fix(meteor): Scroll position is lost when loading older messages diff --git a/apps/meteor/app/ui-utils/client/lib/RoomHistoryManager.ts b/apps/meteor/app/ui-utils/client/lib/RoomHistoryManager.ts index 2cbe01bafb9d..c9adbad5cbb5 100644 --- a/apps/meteor/app/ui-utils/client/lib/RoomHistoryManager.ts +++ b/apps/meteor/app/ui-utils/client/lib/RoomHistoryManager.ts @@ -164,7 +164,7 @@ class RoomHistoryManagerClass extends Emitter { room.unreadNotLoaded.set(result.unreadNotLoaded); room.firstUnread.set(result.firstUnread); - const wrapper = await waitForElement('.messages-box .wrapper'); + const wrapper = await waitForElement('.messages-box .wrapper .rc-scrollbars-view'); if (wrapper) { previousHeight = wrapper.scrollHeight;