Fix reaction picker hiding on less timeline content auto scroll

This commit is contained in:
ayumi-signal 2024-01-29 12:08:22 -08:00 committed by GitHub
parent 6fa12e006e
commit c6a7637513
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -240,9 +240,15 @@ export class Timeline extends React.Component<
);
private onScroll = (event: UIEvent): void => {
if (event.isTrusted) {
// When content is removed from the viewport, such as typing indicators leaving
// or messages being edited smaller or deleted, scroll events are generated and
// they are marked as user-generated (isTrusted === true). Actual user generated
// scroll events with movement must scroll a nonbottom state at some point.
const isAtBottom = this.isAtBottom();
if (event.isTrusted && !isAtBottom) {
this.scrollerLock.onUserInterrupt('onScroll');
}
// hasRecentlyScrolled is used to show the floating date header, which we only
// want to show when scrolling through history or on conversation first open.
// Checking bottom prevents new messages and typing from showing the header.