Skip to content

fix: auto-scroll to new message when inverted is false (#2612)#2745

Merged
kesha-antonov merged 1 commit into
masterfrom
fix/autoscroll-non-inverted
Jun 18, 2026
Merged

fix: auto-scroll to new message when inverted is false (#2612)#2745
kesha-antonov merged 1 commit into
masterfrom
fix/autoscroll-non-inverted

Conversation

@kesha-antonov

Copy link
Copy Markdown
Collaborator

Fixes #2612

Problem

With isInverted={false}, new messages are appended to the end of the list but it never scrolls to reveal them, so incoming/sent messages stay off-screen. (Inverted lists don't have this issue - they keep the newest message visible automatically.)

Fix

Track the latest message id; when it changes in a non-inverted list, scroll to the bottom. Gated on the user already being near the bottom, so it doesn't yank someone away while they're reading earlier messages - matching how the inverted list behaves.

Validation

Built the example with isInverted={false} and sent messages on both simulators:

  • ✅ iOS (iPhone 17 Pro) - sent message auto-scrolled into view at the bottom
  • ✅ Android (Pixel 10 Pro) - sent message auto-scrolled into view at the bottom
  • Verified the near-bottom gate: when scrolled up in history, it does not force-scroll.

tsc, eslint, and build pass locally; CI (Node 22 & 24) gates this PR.

A non-inverted message list appends new messages off-screen at the end and
never scrolled to reveal them (inverted lists keep the newest message
visible on their own). Track the latest message and, when it changes in a
non-inverted list, scroll to the bottom - but only when the user is already
near the bottom, so it doesn't yank them away while reading earlier messages.
@kesha-antonov kesha-antonov merged commit 7622251 into master Jun 18, 2026
2 checks passed
@kesha-antonov kesha-antonov deleted the fix/autoscroll-non-inverted branch June 18, 2026 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Autoscrolling to new message is not working when inverted is false

1 participant