diff --git a/crates/story/src/form_story.rs b/crates/story/src/form_story.rs index c02e733e..41c38802 100644 --- a/crates/story/src/form_story.rs +++ b/crates/story/src/form_story.rs @@ -183,7 +183,7 @@ impl Render for FormStory { ) .child( form_field() - .label("Birthday") + .label("Please select your birthday") .child(DatePicker::new(&self.date)) .description("Select your birthday, we will send you a gift."), ) diff --git a/crates/ui/src/form.rs b/crates/ui/src/form.rs index f136690f..d7e1db35 100644 --- a/crates/ui/src/form.rs +++ b/crates/ui/src/form.rs @@ -378,14 +378,18 @@ impl RenderOnce for FormField { .items_center() .when_some(self.label, |this, builder| { this.child( - h_flex().gap_1().child(builder.render(window, cx)).when( - self.required, - |this| { + h_flex() + .gap_1() + .child( + div() + .overflow_x_hidden() + .child(builder.render(window, cx)), + ) + .when(self.required, |this| { this.child( div().text_color(cx.theme().danger).child("*"), ) - }, - ), + }), ) }), )