form: Add text wrapping support for label (#907)

This commit is contained in:
Floyd Wang 2025-05-27 19:31:06 +08:00 committed by GitHub
parent bad9506ebb
commit 49f1ac511d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -331,9 +331,7 @@ impl RenderOnce for FormField {
#[inline]
fn wrap_label(label_width: Option<Pixels>) -> Div {
h_flex()
.truncate()
.when_some(label_width, |this, width| this.w(width).flex_shrink_0())
div().when_some(label_width, |this, width| this.w(width).flex_shrink_0())
}
let gap = match self.props.gap {
@ -390,7 +388,7 @@ impl RenderOnce for FormField {
}),
)
})
.child(div().w_full().child(self.child)),
.child(div().flex_1().overflow_x_hidden().child(self.child)),
)
.child(
// Other