Repository navigation
fix(ios): request layout on height changes and replay it when resuming native updates - #10
Merged
Merged
Conversation
…dates _resumeNativeUpdates(..., shouldResumeRequestLayout) cleared the suspend flag but left _requetLayoutNeeded set, so a view updated with requestLayout suspended (recycled collection view cells) was measured again with its cached size and kept its previous dimensions. Call requestlayoutIfNeeded() after resuming, like onLoaded does. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…anges 78c71a9 moved the requestLayout call of CssAnimationProperty inside the `view[setNative]` check. Properties that have no native setter on iOS (height, width, margins) then never requested a layout when they changed: a view bound to new data kept its previous measured size (recycled collection view cells drawn offset in their cell). Request the layout whenever the value actually changed, setter or not. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
farfromrefug
marked this pull request as ready for review
October 19, 2026 18:10
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.
What is the current behavior?
Recycled
CollectionViewcells (ui-collectionview svelte wrapper) kept the height of the previous item and were drawn offset in their cell. Two causes in core:view.requestLayout()in theCssAnimationPropertysetter inside theview[setNative]check. Properties without a native setter on iOS (height,width, margins) no longer request a layout when they change._resumeNativeUpdates(type, recursive, shouldResumeRequestLayout)clearssuspendRequestLayoutbut never replays therequestLayoutcalls swallowed while suspended (they only set_requetLayoutNeeded). The wrapper suspends them while re-binding a cell, so the next measure reuses the cached size.What is the new behavior?
requestLayout()is called whenever the value actually changed, setter or not (the "only if changed" part of 78c71a9 is kept).shouldResumeRequestLayoutis set,requestlayoutIfNeeded()runs after the resume (same pattern asonLoaded). Only the ui-collectionview svelte wrapper passesshouldResumeRequestLayout = true.No automated test (needs iOS cell recycling). Checked manually on Mac Catalyst (weather app daily list, production JS build) together with nativescript-community/ui-collectionview#108: the canvas of every recycled row now matches its cell on the second layout pass.
🤖 Generated with Claude Code