Scroll bug - #3796
Draft
szuperaz wants to merge 2 commits into
Draft
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
π― Goal
π Implementation details
π¨ UI Changes
iOS
Android
π§ͺ Testing
βοΈ Checklist
developbranch