mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2026-06-19 00:01:59 +00:00
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.
This commit is contained in:
parent
884a0140aa
commit
da5e002db1
Notes:
github-actions[bot]
2026-04-22 13:16:46 +00:00
Author: https://github.com/tcl3
Commit: da5e002db1
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/9020
Reviewed-by: https://github.com/trflynn89 ✅
5 changed files with 68 additions and 25 deletions
|
|
@ -54,7 +54,7 @@ void HTMLOptionElement::update_selection_label()
|
|||
{
|
||||
if (selected()) {
|
||||
if (auto* select_element = first_ancestor_of_type<HTMLSelectElement>()) {
|
||||
select_element->update_inner_text_element({});
|
||||
select_element->clone_selected_option_into_select_button();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue