Add AutoComplete support to InputControl component

This commit is contained in:
Luis Eduardo Jeréz Girón
2024-07-22 18:09:42 -06:00
parent d771633e15
commit 5a4bf12c9c
2 changed files with 30 additions and 25 deletions
+18 -15
View File
@@ -24,27 +24,30 @@ func createFirstUserPage() gomponents.Node {
html.Class("mt-4 space-y-2"),
component.InputControl(component.InputControlParams{
Name: "name",
Label: "Full name",
Placeholder: "John Doe",
Required: true,
Type: component.InputTypeText,
Name: "name",
Label: "Full name",
Placeholder: "John Doe",
Required: true,
Type: component.InputTypeText,
AutoComplete: "name",
}),
component.InputControl(component.InputControlParams{
Name: "email",
Label: "Email",
Placeholder: "john@example.com",
Required: true,
Type: component.InputTypeEmail,
Name: "email",
Label: "Email",
Placeholder: "john@example.com",
Required: true,
Type: component.InputTypeEmail,
AutoComplete: "email",
}),
component.InputControl(component.InputControlParams{
Name: "password",
Label: "Password",
Placeholder: "******",
Required: true,
Type: component.InputTypePassword,
Name: "password",
Label: "Password",
Placeholder: "******",
Required: true,
Type: component.InputTypePassword,
AutoComplete: "new-password",
}),
component.InputControl(component.InputControlParams{
+12 -10
View File
@@ -24,19 +24,21 @@ func loginPage() gomponents.Node {
html.Class("mt-4 space-y-2"),
component.InputControl(component.InputControlParams{
Name: "email",
Label: "Email",
Placeholder: "john@example.com",
Required: true,
Type: component.InputTypeEmail,
Name: "email",
Label: "Email",
Placeholder: "john@example.com",
Required: true,
Type: component.InputTypeEmail,
AutoComplete: "email",
}),
component.InputControl(component.InputControlParams{
Name: "password",
Label: "Password",
Placeholder: "******",
Required: true,
Type: component.InputTypePassword,
Name: "password",
Label: "Password",
Placeholder: "******",
Required: true,
Type: component.InputTypePassword,
AutoComplete: "current-password",
}),
html.Div(