Conversation
|
Hi @adamhari! Thank you for your pull request and welcome to our community. Action RequiredIn 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. ProcessIn 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 If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
Summary:
Issue #51911 reports that
measureandmeasureInWindowreturn the original y coordinate while an iOS Fabric sticky header is visibly stuck. On currentmain, 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.
ScrollViewStickyHeadercurrently 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.measureandmeasureInWindow, 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.