Add AutoComplete support to InputControl component

This commit is contained in:
Luis Eduardo Jeréz Girón
2024-07-22 18:08:17 -06:00
parent cafef69df6
commit d771633e15
+13 -8
View File
@@ -8,14 +8,15 @@ import (
)
type InputControlParams struct {
Name string
Label string
Placeholder string
Required bool
Type inputType
HelpText string
Color color
Children []gomponents.Node
Name string
Label string
Placeholder string
Required bool
Type inputType
HelpText string
Color color
AutoComplete string
Children []gomponents.Node
}
func InputControl(params InputControlParams) gomponents.Node {
@@ -51,6 +52,10 @@ func InputControl(params InputControlParams) gomponents.Node {
params.Required,
html.Required(),
),
gomponents.If(
params.AutoComplete != "",
html.AutoComplete(params.AutoComplete),
),
gomponents.Group(params.Children),
),
gomponents.If(