Files
ladybird/Tests/LibWeb/Layout/input/select-innerhtml-optgroup-selected-option.html
Tim Ledbetter da5e002db1 LibWeb: Keep select button text in sync with the selected option
Previously, the select button's text was only refreshed inside the
two non-trivial branches of the selectedness setting algorithm.
Paths that left the select with exactly one selected option hit a
no-op branch and skipped the refresh.

Fix this by implementing the "clone selected option into select
button" algorithm and invoking it whenever the set of selected options
may have changed.
2026-04-22 09:15:29 -04:00

7 lines
232 B
HTML

<!DOCTYPE html>
<select id="s"></select>
<script>
document.getElementById("s").innerHTML =
'<optgroup label="G"><option>Option 1</option><option selected>Option 2</option><option>Option 3</option></optgroup>';
</script>