fix(core): iOS child index mapping skips the glass effect subview - #11410
Open
NathanWalker wants to merge 1 commit into
Open
NathanWalker wants to merge 1 commit into
NathanWalker wants to merge 1 commit into
Conversation
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.
|
View your CI Pipeline Execution ↗ for commit ff2e222
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
commit: |
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.
iosGlassEffectinserts aUIVisualEffectViewat 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:
Viewhad no iOS-specific mapping at all, andLayoutBaseCommonoverrides the mapping to count the native views of preceding children (forProxyViewContainer) without deferring to the platform base, so aView-level fix alone never reached layouts.Fix
View(iOS) maps a child index toindex + 1while the glass effect view is attached to the view.LayoutBaseCommonkeeps its proxy-aware count and hands the result tosuper._childIndexToNativeChildIndex, so the platform offset applies to layouts too.