Skip to content

fix(ios): pass box shadow to shadow paths during size animations - #11680

Merged
NathanWalker merged 1 commit into
mainfrom
fix/ios-shadow-animation-paths
Nov 27, 2026
Merged

NathanWalker merged 1 commit into
mainfrom
fix/ios-shadow-animation-paths

Conversation

@NathanWalker

Copy link
Copy Markdown
Contributor

PR Checklist

What is the current behavior?

#10777 (multiple CSS box-shadows) changed ios.generateShadowLayerPaths in ui/styling/background.ios.ts from (view, bounds) to (view, boxShadow, bounds) and updated its caller in drawBoxShadow. The iOS size-animation path in ui/animation/index.ios.ts (animateNestedLayerSizeUsingBasicAnimation) was missed and still calls generateShadowLayerPaths(view, bounds). So when you animate width/height on a view with a box-shadow, the CGRect is read as the box shadow and bounds is undefined. The paths come out wrong, or the call throws on bounds.size.

TypeScript didn't catch it because the handwritten ui/styling/background.d.ts still declared the old 2-arg signature.

What is the new behavior?

  • During a size animation, each outer shadow layer gets paths built from its own box shadow (backgroundInternal.getBoxShadows()[i]). This uses the same layer-to-shadow index mapping as drawBoxShadow. A layer with no matching box shadow is skipped.
  • background.d.ts now declares generateShadowLayerPaths(view, boxShadow, bounds). With only that change, tsc -p packages/core/tsconfig.lib.json reports TS2554: Expected 3 arguments, but got 2 at the old call site. The other ios.* helper declarations in background.d.ts match background.ios.ts.
  • New unit spec ui/animation/index.ios.spec.ts drives animateNestedLayerSizeUsingBasicAnimation with 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 on main and pass with this change.

To check on a device: in the toolbox box-shadow page, animate the width/height of 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.

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.
@nx-cloud

nx-cloud Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 955ad8d

Command Status Duration Result
nx test apps-automated -c=android ✅ Succeeded 3m 22s View ↗
nx run-many --target=test --configuration=ci --... ✅ Succeeded <1s View ↗

💡 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 2026-11-25 22:00:21 UTC

@NathanWalker NathanWalker added this to the 9.2 milestone Nov 25, 2026
@pkg-pr-new

pkg-pr-new Bot commented Nov 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@nativescript/core@11680
npm i https://pkg.pr.new/@nativescript/vite@11680
npm i https://pkg.pr.new/@nativescript/webpack@11680

commit: 955ad8d

@CatchABus CatchABus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice finding @NathanWalker!

@NathanWalker
NathanWalker merged commit e58b67f into main Nov 27, 2026
13 checks passed
@NathanWalker
NathanWalker deleted the fix/ios-shadow-animation-paths branch November 27, 2026 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants