From d771633e15b01780113fcd2157bccb03482f6131 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Eduardo=20Jer=C3=A9z=20Gir=C3=B3n?= Date: Mon, 22 Jul 2024 18:08:17 -0600 Subject: [PATCH] Add AutoComplete support to InputControl component --- internal/view/web/component/input_control.go | 21 ++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/internal/view/web/component/input_control.go b/internal/view/web/component/input_control.go index f564efa..74a8f5d 100644 --- a/internal/view/web/component/input_control.go +++ b/internal/view/web/component/input_control.go @@ -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(