Skip to content

fix: maintainVisibleContentPosition not compensating for height changes of first visible view - #55545

Open
zhu-xiaowei wants to merge 1 commit into
react:mainfrom
zhu-xiaowei:fix/maintain-visible-content-position-size-change
Open

zhu-xiaowei wants to merge 1 commit into
react:mainfrom
zhu-xiaowei:fix/maintain-visible-content-position-size-change

Conversation

@zhu-xiaowei

@zhu-xiaowei zhu-xiaowei commented Feb 13, 2026 •

Copy link
Copy Markdown

The algorithm only compared the first visible view's origin before and after a mounting transaction. When the first visible view grows in size without changing its origin, content after it shifts but no scroll compensation was applied. This adds a size-change check that fires only when the origin delta is negligible, covering scenarios like streaming chat messages in inverted FlatLists, lazy-loaded images, and expandable content.

Summary:

Changelog:

[General] [Fixed] - maintainVisibleContentPosition now compensates for size changes of the
first visible view, not just origin changes

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

Test Plan:

…es of first visible view

The algorithm only compared the first visible view's origin before and after
a mounting transaction. When the first visible view grows in size without
changing its origin, content after it shifts but no scroll compensation was
applied. This adds a size-change check that fires only when the origin delta
is negligible, covering scenarios like streaming chat messages in inverted
FlatLists, lazy-loaded images, and expandable content.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@meta-cla

meta-cla Bot commented Feb 13, 2026

Copy link
Copy Markdown

Hi @zhu-xiaowei!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 13, 2026
@meta-cla

meta-cla Bot commented Feb 13, 2026

Copy link
Copy Markdown

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Feb 13, 2026
@meta-codesync

meta-codesync Bot commented Feb 13, 2026

Copy link
Copy Markdown

@CalixTang has imported this pull request. If you are a Meta employee, you can view this in D93265420.

@NickGerleman

Copy link
Copy Markdown
Contributor

How does this logic compare to comparing bottom of first frame?

@react-native-bot

Copy link
Copy Markdown
Collaborator

This PR is stale because it has been open for 180 days with no activity. It will be closed in 7 days unless you comment on it or remove the "Stale" label.

@react-native-bot react-native-bot added Stale There has been a lack of activity on this issue and it may be closed soon. and removed Stale There has been a lack of activity on this issue and it may be closed soon. labels Aug 19, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants