Skip to content

Commit

Permalink
fix: add children to text input on datalist
Browse files Browse the repository at this point in the history
  • Loading branch information
katallaxie authored Aug 22, 2024
1 parent 9dfa52d commit 77c8eb2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/forms/datalist.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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),
Expand Down

0 comments on commit 77c8eb2

Please sign in to comment.