From 25a022da63e7923d0102e5adcf1c44199ba7dcf6 Mon Sep 17 00:00:00 2001 From: VickyStash Date: Wed, 11 Feb 2026 18:20:09 +0100 Subject: [PATCH] Fix items height normalization after layout change --- .../layout-managers/LinearLayoutManager.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/recyclerview/layout-managers/LinearLayoutManager.ts b/src/recyclerview/layout-managers/LinearLayoutManager.ts index c7e781cb2..55e8d1675 100644 --- a/src/recyclerview/layout-managers/LinearLayoutManager.ts +++ b/src/recyclerview/layout-managers/LinearLayoutManager.ts @@ -135,8 +135,16 @@ export class RVLinearLayoutManagerImpl extends RVLayoutManager { layout.minHeight = targetMinHeight; } newTallestItem.minHeight = 0; - this.tallestItem = newTallestItem; - this.tallestItemHeight = newTallestItem.height; + // When items shrink (targetMinHeight = 0), reset tracking so the + // next cycle re-detects the tallest item after repaint and properly + // re-applies minHeight for all layouts. + if (targetMinHeight === 0) { + this.tallestItem = undefined; + this.tallestItemHeight = 0; + } else { + this.tallestItem = newTallestItem; + this.tallestItemHeight = newTallestItem.height; + } } }