From 77c8eb240980d0060b175225e9b949a27baebe5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20D=C3=B6ll?= Date: Thu, 22 Aug 2024 05:48:15 +0000 Subject: [PATCH] fix: add children to text input on datalist --- components/forms/datalist.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/forms/datalist.go b/components/forms/datalist.go index 5ca1555..f6b7bbd 100644 --- a/components/forms/datalist.go +++ b/components/forms/datalist.go @@ -26,7 +26,7 @@ type DatalistProps struct { } // Datalist is a component that displays a datalist. -func Datalist(props DatalistProps) htmx.Node { +func Datalist(props DatalistProps, children ...htmx.Node) htmx.Node { return htmx.Fragment( htmx.Script(htmx.Raw(`function checkUserKeydown(event) {return event instanceof KeyboardEvent}`)), TextInputBordered( @@ -41,6 +41,7 @@ func Datalist(props DatalistProps) htmx.Node { htmx.HxTarget(fmt.Sprintf("#%s", props.ID)), htmx.HxTrigger("load, keyup[checkUserKeydown.call(this, event)] changed delay:350ms"), htmx.HxIndicator(utilx.IfElse(utilx.Empty(props.Indicator), htmx.HxClssNameIndicatorSelector, props.Indicator)), + htmx.Group(children...), ), htmx.DataList( htmx.ID(props.ID),