RN: Return zero measure values in measure API when ReactRootView cannot be found in view hierarchy#51994
RN: Return zero measure values in measure API when ReactRootView cannot be found in view hierarchy#51994Coiggahou2002 wants to merge 1 commit into
Conversation
…ot be found in view hierarchy
|
Hi @Coiggahou2002! 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! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
|
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. |
|
This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
|
This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
Summary:
This PR addresses a critical issue with the
measureAPI on iOS when used in conjunction withremoveClippedSubviewsin FlatList. The current implementation can lead to incorrect intersection measurements, particularly affecting components that rely on accurate view measurements for features like exposure tracking.The root cause is that when
removeClippedSubviewsis enabled, views outside the visible area are removed from their superview. When measure is called on these views, it fails to properly traverse up to theRCTRootView, resulting in incorrect coordinate calculations. This leads to false positives in intersection detection, especially for components implementing exposure tracking functionality.The fix follows Android's more robust implementation by adding proper validation to ensure measurements are always relative to RCTRootView, and returning appropriate values when this cannot be achieved.
Changelog:
[IOS] [FIXED] - Fixed incorrect measurements from measure API when used with removeClippedSubviews
Test Plan:
The testing video/representation is on the way.