Skip to content

Scroll bug - #3796

Draft
szuperaz wants to merge 2 commits into
developfrom
scroll-bug
Draft

Scroll bug#3796
szuperaz wants to merge 2 commits into
developfrom
scroll-bug

Conversation

@szuperaz

@szuperaz szuperaz commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

🎯 Goal

πŸ›  Implementation details

🎨 UI Changes

iOS
Before After
Android
Before After

πŸ§ͺ Testing

β˜‘οΈ Checklist

  • I have signed the Stream CLA (required)
  • PR targets the develop branch
  • Documentation is updated
  • New code is tested in main example apps, including all possible scenarios
    • SampleApp iOS and Android
    • Expo iOS and Android

szuperaz and others added 2 commits September 2, 2026 09:28
Applied from PR #3793 to reproduce the maintainVisibleContentPosition
scroll-anchor bug when an already-measured message grows in place.
`QuickReplyPills` renders a horizontal `FlatList`, and RN applies
`flexGrow: 1` to every ScrollView through its internal `baseHorizontal`
style. Inside the message bubble's column layout the parent's main axis is
height, so the list expanded to consume all available vertical space β€” a
bubble containing the single word "1311" measured 1234px (~617dp), filling
the entire message list viewport.

That produced two symptoms that together looked like a scroll-position bug
in the SDK:

- The viewport was covered by one almost-empty bubble, so the list read as
  blank.
- Each row growing ~50px -> ~1234px in place is an enormous mid-flight
  resize, so the native maintainVisibleContentPosition anchor correction was
  correspondingly enormous and clamped to `contentHeight - viewportHeight`
  (measured 1771.7 = 2429.9 - 658.1), parking the list at the oldest end
  before smooth-scrolling back.

Setting `flexGrow: 0` on the list's own `style` overrides RN's default
(`props.style` composes over the base style) and lets the list size to its
content. Measured on a Galaxy A12: bubbles 158px, all pills rendered, list
pinned to the newest message, no scroll correction.

Preferred over pinning `height`/`maxHeight` because it addresses the cause
rather than fencing it in, needs no magic number kept in sync with the pill
metrics, and lets the row grow for large system font sizes instead of
clipping.

Verified on Android only; iOS is untested.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

1 participant