Refactor input control to include pattern attribute

This commit is contained in:
Luis Eduardo Jeréz Girón
2024-08-03 21:26:56 -06:00
parent d1f282d413
commit d157f8a72f

View File

@@ -18,6 +18,7 @@ type InputControlParams struct {
HelpText string
Color color
AutoComplete string
Pattern string
Children []gomponents.Node
HelpButtonChildren []gomponents.Node
}
@@ -73,6 +74,10 @@ func InputControl(params InputControlParams) gomponents.Node {
params.AutoComplete != "",
html.AutoComplete(params.AutoComplete),
),
gomponents.If(
params.Pattern != "",
html.Pattern(params.Pattern),
),
gomponents.Group(params.Children),
),
gomponents.If(