Skip to content

Attrtibute disappearing on update #63

Description

@voodoos

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]
image

But instead it is closed:

image

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions