Closed ghivert closed 2 months ago
When setting selected on an option in a select at first paint, the field is not the one selected.
selected
option
select
Demo
https://github.com/lustre-labs/lustre/assets/7314118/34c4b3cd-1602-4fea-9dc9-fc1de6060fa4
Gleam code as pseudo-code
h.select([event.on_input(on_cs_input), s.select_cs()], { use item <- list.map(list_) let selected = selected_item == item h.option([a.value(as_s), a.selected(selected)], as_s) })
HTML produced
<select class="css-0006"> <option value="Ayu Dark" selected="false">Ayu Dark</option> <option value="Ayu Light" selected="true">Ayu Light</option> <option value="Gleam" selected="false">Gleam</option> </select>
And yet, it displays "Gleam" (the last one).
When setting
selected
on anoption
in aselect
at first paint, the field is not the one selected.Demo
https://github.com/lustre-labs/lustre/assets/7314118/34c4b3cd-1602-4fea-9dc9-fc1de6060fa4
Gleam code as pseudo-code
HTML produced
And yet, it displays "Gleam" (the last one).