Skip to content

Commit

Permalink
html: fix fragment rendering order
Browse files Browse the repository at this point in the history
  • Loading branch information
rizo committed Mar 31, 2024
1 parent 5d36624 commit 53c7377
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions vendor/html/src/Html.ml
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,14 @@ let elem name attrs children =
{ mount; unmount }

let fragment children =
let mount ~parent ~insert =
List.iter (fun child -> Elem_util.mount ~parent ~insert child) children
let mount ~parent:_ ~insert =
let fragment_node = Dom.Fragment.make () in
List.iter
(fun child_html -> Elem_util.mount ~parent:fragment_node child_html)
children;
insert fragment_node
in
let unmount () = List.iter (fun child -> child.unmount ()) children in
let unmount () = List.iter Elem_util.unmount children in
{ mount; unmount }

let text data =
Expand Down

0 comments on commit 53c7377

Please sign in to comment.