Repository navigation
fix(ios): reset the layer transform before setting a frame under an animation - #7
Merged
Merged
Conversation
…nimation _modifyNativeViewFrame resets the transform to identity before setting the frame, since UIKit counts a frame set under a transform against it. It decided from _isTransformed, which updateNativeTransform keeps. An Animation sets layer.transform first and the view's properties after, which then match and skip updateNativeTransform, so the flag still read untransformed. A view re-laid out while animated (a bottom sheet growing as it slides up) got its translation counted twice and landed off screen. The check now reads the layer's actual transform; the flag had no other use and is removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
PR Checklist
packages/coretypechecks.What is the current behavior?
_modifyNativeViewFramesets the layer transform to identity before setting a frame (UIKit counts a frame set under a transform against it), but decides from_isTransformed. That flag is only updated inupdateNativeTransform. AnAnimationsetslayer.transformnatively first, then the view's properties, which then already match and skipupdateNativeTransform, so the flag staysfalse.A view re-laid out while it carries an animated translation gets that translation counted twice. Hit in alpimaps with
ui-persistent-bottomsheet: the sheet content grows (523 → 561 pt) while it slides up, its resting frame shifts down by the translation (124 pt), and the sheet ends just below the window edge.What is the new behavior?
The check reads the layer's actual transform (
!CATransform3DEqualToTransform(nativeView.layer.transform, CATransform3DIdentity), as elsewhere in the file)._isTransformedhad no other use and is removed.Verified in alpimaps on Mac Catalyst (same code path as iOS): selecting a point item then a route, the sheet now stays up.
🤖 Generated with Claude Code