Skip to content

Commit 3f85c5b

Browse files
authored
Merge pull request #10 from Akylas/fix/resume-request-layout
fix(ios): request layout on height changes and replay it when resuming native updates
2 parents 58a1d37 + 06777ea commit 3f85c5b

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

‎packages/core/ui/core/properties/index.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -834,9 +834,10 @@ export class CssAnimationProperty<T extends Style, U> implements CssAnimationPro
834834
}
835835
}
836836
}
837-
if (property.affectsLayout) {
838-
view.requestLayout();
839-
}
837+
}
838+
// properties without a native setter (height, width, margins on iOS) still need the layout
839+
if (property.affectsLayout && (computedValueChanged || isSet !== wasSet)) {
840+
view.requestLayout();
840841
}
841842
const eventName = property.eventName;
842843
if (computedValueChanged && (!__UI_USE_EXTERNAL_RENDERER__ || !view._suspendNativeUpdatesCount) && this.hasListeners(eventName)) {

‎packages/core/ui/core/view-base/index.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -823,6 +823,11 @@ export abstract class ViewBase extends Observable {
823823
if (!this._suspendNativeUpdatesCount) {
824824
this.onResumeNativeUpdates();
825825
}
826+
if (shouldResumeRequestLayout) {
827+
// layout requests received while suspended were only recorded: replay them now,
828+
// otherwise the next measure reuses the cached size and ignores the changes
829+
this.requestlayoutIfNeeded();
830+
}
826831
}
827832

828833
/**

0 commit comments

Comments
 (0)