Fix floating date header when not scrolling
This commit is contained in:
parent
b2d4e8cd56
commit
8f6fe60342
1 changed files with 7 additions and 0 deletions
|
@ -243,6 +243,13 @@ export class Timeline extends React.Component<
|
|||
if (event.isTrusted) {
|
||||
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.
|
||||
if (!this.state.hasRecentlyScrolled && this.isAtBottom()) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.setState(oldState =>
|
||||
// `onScroll` is called frequently, so it's performance-sensitive. We try our best
|
||||
// to return `null` from this updater because [that won't cause a re-render][0].
|
||||
|
|
Loading…
Add table
Reference in a new issue