mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 18:17:22 +02: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:
Notes:
github-actions[bot]
2026-04-22 13:16:46 +00:00
Author: https://github.com/tcl3 Commit: https://github.com/LadybirdBrowser/ladybird/commit/da5e002db18 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/9020 Reviewed-by: https://github.com/trflynn89 ✅
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user