fix: translated into viewport PortalWhileClosingView#3512
Merged
isekovanic merged 2 commits intodevelopfrom Mar 25, 2026
Merged
fix: translated into viewport PortalWhileClosingView#3512isekovanic merged 2 commits intodevelopfrom
isekovanic merged 2 commits intodevelopfrom
Conversation
Contributor
SDK Size
|
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.
🎯 Goal
THis PR addresses a very peculiar issue we have with our
PortalWhileClosingView. Namely, any time thePortalWhileClosingViewis rendered some place else than the actual viewport (a common example would be the JSstackversion ofreact-navigation, where the entire screen is first rendered offscreen and then translated into view) our previous setup would take layout measurements wrong (as it would do it on mount initially, while the view is completely offset).This would of course resolve itself if
onLayoutis ever invoked again on thechildrenproperty ofPortalWhileClosingView, however this is in no way guaranteed (as even the initialonLayouthappens offscreen). Instead, we change the logic to only measure when:onLayoutis invoked while the overlay is openWe don't particularly care about any other scenario anyway. This is additionally a slight performance boost as well, as for example children with very heavy layout animations (for example animating
scaledirectly on someinterpolation, or basically anything which callsonLayoutvery often). We do pay the cost on initial teleport, but it's negligible and does not at all stress any of the threads out.🛠 Implementation details
🎨 UI Changes
iOS
Android
🧪 Testing
☑️ Checklist
developbranch