Repository navigation
Leave a view untransformed on iOS when its transform is not finite - #59133
Open
YevheniiKotyrlo wants to merge 1 commit into
Open
YevheniiKotyrlo wants to merge 1 commit into
YevheniiKotyrlo wants to merge 1 commit into
Conversation
Contributor
Author
YevheniiKotyrlo
marked this pull request as ready for review
October 16, 2026 12:36
This branch has not been deployed
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.


Summary:
A view whose transform holds a
NaNdisappears on iOS, together with the siblings drawn before it. On Android the same view renders untransformed and its siblings are unaffected. I hit it through Reanimated, whosewithTimingcomputes aNaNfor anundefinedduration, but any transform computed asNaNdoes it.RCTCATransform3DFromTransformMatrixcopies the resolved matrix into aCATransform3Dunchecked, so theNaNreaches Core Animation. Android'sBaseViewManagerreads each transform value throughsanitizeFloatPropertyValuefirst, and on iOSupdateLayoutMetricsalready skips a non-finite frame because aCALayercannot take one.RCTCATransform3DFromTransformMatrixnow returns the identity for a matrix with a non-finite entry, soRCTViewComponentViewand the synchronous update inRCTMountingManagerrender the view untransformed, as Android does.Changelog:
[IOS] [FIXED] - Render a view untransformed when its transform is not finite, instead of hiding it and the siblings drawn before it
Test Plan:
RCTViewComponentViewTestsgains three cases that set a transform throughupdateProps: a translate withNaNand a scale with infinity leave the layer's transform at the identity, and a finite translate is applied. I ranReact-RCTFabric's test spec on an iPad (iOS 27.0.1), with the spec enabled in RNTester's Podfile locally: all 22RCTViewComponentViewTestspass with this change, and withmain'sRCTConversions.htheNaNand infinity cases fail. The spec's one other failure,RCTTextInputUtilsTest testCopyBackedTextInputPreservesTintColor, fails the same way onmainon that device.mainand of this change on the same iPad, with a root component that renders a build label, a button, a view whosetranslateXbecomesNaNafter mount, and a second view. Onmainonly the second view is drawn: the label, the button and theNaNview are gone. With this change all four are drawn and theNaNview sits untransformed. The before and after are in a comment below.