Skip to content

Fix stale Fabric sticky header measurements after unsticking - #58656

Closed
adamhari wants to merge 2 commits into
react:mainfrom
adamhari:codex/fix-sticky-header-measure
Closed

adamhari wants to merge 2 commits into
react:mainfrom
adamhari:codex/fix-sticky-header-measure

Conversation

@adamhari

@adamhari adamhari commented Sep 23, 2026 •

Copy link
Copy Markdown

Summary:

Issue #51911 reports that measure and measureInWindow return the original y coordinate while an iOS Fabric sticky header is visibly stuck. On current main, the native interpolation listener needed to mirror the sticky translation into Fabric was restored by #58037. That earlier change addresses the reported sticky-state failure; this PR does not reimplement it.

This PR covers the sticky header's native event path and fixes a remaining stale measurement when the header returns to its layout position. ScrollViewStickyHeader currently ignores the first zero from every interpolation listener. After a nonzero sticky translation, a later zero is a real position update. Scope the initial-zero guard to each new interpolation so that later zero reaches the Fabric shadow tree. The regression test sends native interpolation updates for initial zero, sticky translation, and return to zero, then checks the explicit transform that Fabric uses for measurement.

Related to #51911. Depends on the listener behavior restored in #58037.

Changelog:

[GENERAL] [FIXED] - Keep Fabric sticky header measurements in sync when a header returns to its layout position.

Test Plan:

  • corepack yarn test packages/react-native/Libraries/Components/ScrollView/__tests__/ScrollViewStickyHeader-test.js --runInBand --silent — passed (1 test).
  • corepack yarn flow-check — passed (0 errors).
  • corepack yarn eslint --max-warnings 0 packages/react-native/Libraries/Components/ScrollView/ScrollViewStickyHeader.js packages/react-native/Libraries/Components/ScrollView/__tests__/ScrollViewStickyHeader-test.js — passed.
  • corepack yarn prettier --check packages/react-native/Libraries/Components/ScrollView/ScrollViewStickyHeader.js packages/react-native/Libraries/Components/ScrollView/__tests__/ScrollViewStickyHeader-test.js — passed.
  • git diff --check — passed.
  • iOS Fabric manual check remains: run the reproducer from measurement y values for nodes used in stickyHeaderIndices do not match it's sticky positioning #51911, scroll until the header sticks, measure with measure and measureInWindow, then scroll back and measure again. Compare the reported coordinates with the visible header and capture a video. I could not run this check or capture a video on this Windows host without Xcode or an iOS simulator.

@meta-cla

meta-cla Bot commented Sep 23, 2026

Copy link
Copy Markdown

Hi @adamhari!

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!

@adamhari
adamhari marked this pull request as draft September 23, 2026 21:49
@adamhari adamhari closed this Sep 23, 2026
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