form: Fix form label required not in same line. (#1013)

This commit is contained in:
parent
f7d536531d
commit
819161ec58
1 changed files with 9 additions and 7 deletions
|
|
@ -377,13 +377,15 @@ impl RenderOnce for FormField {
|
||||||
.gap_1()
|
.gap_1()
|
||||||
.items_center()
|
.items_center()
|
||||||
.when_some(self.label, |this, builder| {
|
.when_some(self.label, |this, builder| {
|
||||||
this.child(builder.render(window, cx)).when(
|
this.child(
|
||||||
self.required,
|
h_flex().gap_1().child(builder.render(window, cx)).when(
|
||||||
|this| {
|
self.required,
|
||||||
this.child(
|
|this| {
|
||||||
div().text_color(cx.theme().danger).child("*"),
|
this.child(
|
||||||
)
|
div().text_color(cx.theme().danger).child("*"),
|
||||||
},
|
)
|
||||||
|
},
|
||||||
|
),
|
||||||
)
|
)
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue