From d157f8a72f5a7ace0ba0d8052a8bd1e2847c7eb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Eduardo=20Jer=C3=A9z=20Gir=C3=B3n?= Date: Sat, 3 Aug 2024 21:26:56 -0600 Subject: [PATCH] Refactor input control to include pattern attribute --- internal/view/web/component/input_control.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/view/web/component/input_control.go b/internal/view/web/component/input_control.go index fde333e..1ec7799 100644 --- a/internal/view/web/component/input_control.go +++ b/internal/view/web/component/input_control.go @@ -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(