Message List: Fix losing scroll position in unread chats
This commit is contained in:
parent
a6d0f5a220
commit
f3e66ad75e
@ -471,7 +471,7 @@ const MessageList: FC<OwnProps & StateProps & DispatchProps> = ({
|
|||||||
} else if (anchor) {
|
} else if (anchor) {
|
||||||
const newAnchorTop = anchor.getBoundingClientRect().top;
|
const newAnchorTop = anchor.getBoundingClientRect().top;
|
||||||
newScrollTop = scrollTop + (newAnchorTop - (anchorTopRef.current || 0));
|
newScrollTop = scrollTop + (newAnchorTop - (anchorTopRef.current || 0));
|
||||||
} else if (unreadDivider) {
|
} else if (unreadDivider && !scrollOffset) {
|
||||||
newScrollTop = unreadDivider.offsetTop - (hasTools ? UNREAD_DIVIDER_TOP_WITH_TOOLS : UNREAD_DIVIDER_TOP);
|
newScrollTop = unreadDivider.offsetTop - (hasTools ? UNREAD_DIVIDER_TOP_WITH_TOOLS : UNREAD_DIVIDER_TOP);
|
||||||
} else {
|
} else {
|
||||||
newScrollTop = scrollHeight - scrollOffset;
|
newScrollTop = scrollHeight - scrollOffset;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user