-
Notifications
You must be signed in to change notification settings - Fork 449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(MessagesList): do not replace container when switching conversations #14327
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ | |
<!-- size and remain refer to the amount and initial height of the items that | ||
are outside of the viewport --> | ||
<div ref="scroller" | ||
:key="token" | ||
class="scroller messages-list__scroller" | ||
:class="{'scroller--chatScrolledToBottom': isChatScrolledToBottom, | ||
'scroller--isScrolling': isScrolling}" | ||
|
@@ -387,6 +386,9 @@ export default { | |
this.$refs.scroller.scrollTo({ | ||
top: this.$refs.scroller.scrollHeight, | ||
}) | ||
} else if (this.$refs.scroller.clientHeight === this.$refs.scroller.scrollHeight) { | ||
// chat is not scrollable | ||
this.setChatScrolledToBottom(true) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For non-scrollable chats, removes the scroll to bottom on resize |
||
} | ||
}, | ||
|
||
|
@@ -931,10 +933,10 @@ export default { | |
this.displayMessagesLoader = false | ||
this.debounceUpdateReadMarkerPosition() | ||
return | ||
} else if (scrollHeight > clientHeight) { | ||
this.setChatScrolledToBottom(false) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After swtiching to conversation, handleScroll is triggered. Regardless of container height, it sets value to false (whereas it shouldn't for non-scrollable chats) |
||
} | ||
|
||
this.setChatScrolledToBottom(false) | ||
|
||
if ((scrollHeight > clientHeight && scrollTop < 800 && this.isScrolling === 'up') | ||
|| skipHeightCheck) { | ||
if (this.loadingOldMessages || this.isChatBeginningReached) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was added during messages list soft update refactoring, but now it seems to be covered with
messagesList
watcherWith key in place, ResizeObserver loses reference to the scroller