Repository navigation
fix(ios): pass box shadow to shadow paths during size animations - #11680
Merged
Merged
Conversation
Width/height animations of a view with a box-shadow called generateShadowLayerPaths(view, bounds) after #10777 added a boxShadow parameter, so the CGRect was read as the shadow and bounds was undefined. Each outer shadow layer now gets the paths for its own box shadow, matching drawBoxShadow. The handwritten background.d.ts still declared the old 2-arg signature, which hid the mismatch from TypeScript.
|
View your CI Pipeline Execution ↗ for commit 955ad8d
💡 With Ultracache enabled, Nx Cloud learns each task's file inputs in CI and uses them on later runs. Turn on Ultracache in workspace settings ↗ · Read docs ↗ ☁️ Nx Cloud last updated this comment at |
commit: |
CatchABus
approved these changes
Nov 27, 2026
CatchABus
left a comment
Contributor
There was a problem hiding this comment.
Nice finding @NathanWalker!
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
I have read the CLA and I hereby sign the CLA).What is the current behavior?
#10777 (multiple CSS box-shadows) changed
ios.generateShadowLayerPathsinui/styling/background.ios.tsfrom(view, bounds)to(view, boxShadow, bounds)and updated its caller indrawBoxShadow. The iOS size-animation path inui/animation/index.ios.ts(animateNestedLayerSizeUsingBasicAnimation) was missed and still callsgenerateShadowLayerPaths(view, bounds). So when you animatewidth/heighton a view with abox-shadow, theCGRectis read as the box shadow andboundsisundefined. The paths come out wrong, or the call throws onbounds.size.TypeScript didn't catch it because the handwritten
ui/styling/background.d.tsstill declared the old 2-arg signature.What is the new behavior?
backgroundInternal.getBoxShadows()[i]). This uses the same layer-to-shadow index mapping asdrawBoxShadow. A layer with no matching box shadow is skipped.background.d.tsnow declaresgenerateShadowLayerPaths(view, boxShadow, bounds). With only that change,tsc -p packages/core/tsconfig.lib.jsonreportsTS2554: Expected 3 arguments, but got 2at the old call site. The otherios.*helper declarations inbackground.d.tsmatchbackground.ios.ts.ui/animation/index.ios.spec.tsdrivesanimateNestedLayerSizeUsingBasicAnimationwith mocked layers. It checks that each shadow layer is animated to the paths of its own box shadow, and that layers with no matching shadow are skipped. Both tests fail onmainand pass with this change.To check on a device: in the toolbox box-shadow page, animate the
width/heightof a view that has one or more box-shadows (with and without border-radius). The shadows should follow the view's size during the animation.