Skip to content

fix(core): iOS child index mapping skips the glass effect subview - #11410

Open
NathanWalker wants to merge 1 commit into
mainfrom
fix/ios-child-index-glass-effect-subview
Open

NathanWalker wants to merge 1 commit into
mainfrom
fix/ios-child-index-glass-effect-subview

Conversation

@NathanWalker

Copy link
Copy Markdown
Contributor

iosGlassEffect inserts a UIVisualEffectView at subview 0 of the view, so from then on every NativeScript child sits one subview past its child index. The index mapping used when a child is added (_childIndexToNativeChildIndex) still passed child indices through unchanged, so a child inserted at a given position landed one subview lower, beneath the sibling it should precede. Appends were unaffected, which is why it only shows for inserts in the middle: keyed list updates, prepends, conditional views mounting after their siblings.

There were two layers to it: View had no iOS-specific mapping at all, and LayoutBaseCommon overrides the mapping to count the native views of preceding children (for ProxyViewContainer) without deferring to the platform base, so a View-level fix alone never reached layouts.

Fix

  • View (iOS) maps a child index to index + 1 while the glass effect view is attached to the view.
  • LayoutBaseCommon keeps its proxy-aware count and hands the result to super._childIndexToNativeChildIndex, so the platform offset applies to layouts too.

iosGlassEffect inserts a UIVisualEffectView at subview 0 of the view, so
its children live one subview past their child index. The index mapping
still passed child indices through unchanged, and a child inserted at a
given position landed one subview lower, beneath the sibling it should
precede.

The iOS View mapping now adds the effect view's slot while it is
attached, and the layout mapping — which counts the native views of the
preceding children for proxy containers and was overriding the platform
base outright — hands its result to the base so both apply.
@nx-cloud

nx-cloud Bot commented Sep 2, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit ff2e222

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

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-09-02 18:28:01 UTC

@pkg-pr-new

pkg-pr-new Bot commented Sep 2, 2026

Copy link
Copy Markdown

Open in StackBlitz

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

commit: ff2e222

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.

1 participant