I think I it a bug, I made a reproduction in #62
The test should show a single opened <detail> element with some text:
let accordion ~name ~title content =
(* TODO there might a bug in lwd: the open attribute disapears when updated
This does not happen if we use an Elwd.details *)
let at =[
At.name (Jstr.v name);
At.v (Jstr.v "open") (Jstr.v "true") ]
in
El.details ~at
((El.summary [ title ]) :: [ (El.section content) ])
let score = Lwd.var "Notes"
let ui =
let e = Lwd.map (Lwd.get score) ~f:(fun score ->
accordion ~name:"test-acc" ~title:(El.txt' "Bandonéon" )
[El.txt' score])
in
Elwd.div [ `R e]
But instead it is closed:
This only appears after the first update of the text: the element is rebuilt and loses it's open attribute.
In the test the entire details element is static, when the text changes a fresh detail is created.
(Using a Elwd.detail and inly update the text node does not trigger the issue.)
I plan to have a look when I find some time.
I think I it a bug, I made a reproduction in #62
The test should show a single opened
<detail>element with some text:But instead it is closed:
This only appears after the first update of the text: the element is rebuilt and loses it's
openattribute.In the test the entire
detailselement is static, when the text changes a freshdetailis created.(Using a
Elwd.detailand inly update the text node does not trigger the issue.)I plan to have a look when I find some time.