From 5ec4feed3a2de8403dcc632230611cd741376b21 Mon Sep 17 00:00:00 2001 From: Martin Guillon Date: Fri, 2 Oct 2026 23:09:25 +0200 Subject: [PATCH] fix(ios): reset the layer transform before setting a frame under an animation _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 --- packages/core/ui/core/view/index.ios.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/core/ui/core/view/index.ios.ts b/packages/core/ui/core/view/index.ios.ts index 76b44b1fed..6a27ef53c6 100644 --- a/packages/core/ui/core/view/index.ios.ts +++ b/packages/core/ui/core/view/index.ios.ts @@ -43,7 +43,6 @@ export class View extends ViewCommon { */ private _modalAnimatedOptions: Array; private _isLaidOut = false; - private _isTransformed = false; private _privateFlags: number = PFLAG_LAYOUT_REQUIRED | PFLAG_FORCE_LAYOUT; private _cachedFrame: CGRect; private _suspendCATransaction = false; @@ -100,7 +99,6 @@ export class View extends ViewCommon { this._cachedFrame = null; this._isLaidOut = false; - this._isTransformed = false; } public requestLayout(): void { @@ -240,7 +238,9 @@ export class View extends ViewCommon { public _modifyNativeViewFrame(nativeView: UIView, frame: CGRect): void { let transform: CATransform3D; - if (this._isTransformed) { + // the layer's own transform: an animation sets it before the view's properties, which then + // match and skip updateNativeTransform, so a flag kept there would still read untransformed + if (!CATransform3DEqualToTransform(nativeView.layer.transform, CATransform3DIdentity)) { // Always set identity transform before setting frame transform = nativeView.layer.transform; nativeView.layer.transform = CATransform3DIdentity; @@ -487,7 +487,6 @@ export class View extends ViewCommon { if (nativeView.outerShadowContainerLayer) { nativeView.outerShadowContainerLayer.transform = transform; } - this._isTransformed = this.nativeViewProtected && !CATransform3DEqualToTransform(this.nativeViewProtected.transform3D, CATransform3DIdentity); if (!isInTheMiddleOfAnimation) { CATransaction.setDisableActions(false);