From 843b2aebd4620d09786720ab0cc53a7925dc9fd3 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Tue, 5 May 2026 10:38:25 +0200 Subject: [PATCH] :bug: Fix problem with flex layout and text auto-height --- render-wasm/src/shapes/modifiers.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/render-wasm/src/shapes/modifiers.rs b/render-wasm/src/shapes/modifiers.rs index 4c7f6d69d4..895cf890c2 100644 --- a/render-wasm/src/shapes/modifiers.rs +++ b/render-wasm/src/shapes/modifiers.rs @@ -10,6 +10,7 @@ use crate::math::{self as math, bools, identitish, is_close_to, Bounds, Matrix, use common::GetBounds; use crate::error::Result; +use crate::shapes; use crate::shapes::{ ConstraintH, ConstraintV, Frame, Group, GrowType, Layout, Modifier, Shape, TransformEntry, TransformEntrySource, Type, @@ -173,6 +174,7 @@ fn propagate_transform( entries: &mut VecDeque, bounds: &mut HashMap, modifiers: &mut HashMap, + reflown: &mut HashSet, ) -> Result<()> { let Some(shape) = state.shapes.get(&entry.id) else { return Ok(()); @@ -203,6 +205,15 @@ fn propagate_transform( !is_close_to(shape_bounds_before.width(), shape_bounds_after.width()); if width_changed || text_content.needs_update_layout() { text_content.update_layout(resized_selrect); + entries.push_back(Modifier::reflow(shape.id, false)); + + if let Some(parent_id) = shape.parent_id { + for pid in + shapes::all_with_ancestors(&[parent_id], shapes, false).iter() + { + reflown.remove(pid); + } + } } let height = text_content.size.height; let resize_transform = math::resize_matrix( @@ -402,6 +413,7 @@ pub fn propagate_modifiers( &mut entries, &mut bounds, &mut modifiers, + &mut reflown, )?, Modifier::Reflow(id, force_reflow) => { if force_reflow {