Skip to content

fix(ios): request layout on height changes and replay it when resuming native updates - #10

Merged
farfromrefug merged 2 commits into
mainfrom
fix/resume-request-layout
Oct 19, 2026
Merged

farfromrefug merged 2 commits into
mainfrom
fix/resume-request-layout

Conversation

@farfromrefug

@farfromrefug farfromrefug commented Oct 19, 2026 •

Copy link
Copy Markdown

What is the current behavior?

Recycled CollectionView cells (ui-collectionview svelte wrapper) kept the height of the previous item and were drawn offset in their cell. Two causes in core:

  1. 78c71a9 moved view.requestLayout() in the CssAnimationProperty setter inside the view[setNative] check. Properties without a native setter on iOS (height, width, margins) no longer request a layout when they change.
  2. _resumeNativeUpdates(type, recursive, shouldResumeRequestLayout) clears suspendRequestLayout but never replays the requestLayout calls 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?

  1. requestLayout() is called whenever the value actually changed, setter or not (the "only if changed" part of 78c71a9 is kept).
  2. When shouldResumeRequestLayout is set, requestlayoutIfNeeded() runs after the resume (same pattern as onLoaded). Only the ui-collectionview svelte wrapper passes shouldResumeRequestLayout = 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

…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 farfromrefug changed the title fix(core): replay layout requests suppressed while resuming native updates fix(ios): request layout on height changes and replay it when resuming native updates Oct 19, 2026
@farfromrefug
farfromrefug marked this pull request as ready for review October 19, 2026 18:10
@farfromrefug
farfromrefug merged commit 3f85c5b into main Oct 19, 2026
1 of 3 checks passed
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