fix(ui5-toolbar-select): display not updating on programmatic option selection
Problem
Since v2.15.0, changing the selected option programmatically (setting
ToolbarSelectOption.selected = true/false) correctly updated the outer
ui5-toolbar-select-option elements but left the inner ui5-select
display frozen on the initially selected option.
Two root causes:
-
ToolbarSelectOptionhad a custom getter readinghasAttribute("selected"). The framework sets the DOM attribute before calling the property setter, so change detection always sawold === newand skipped invalidation — meaningToolbarSelectnever re-rendered on programmatic changes. -
The template passed
value={this.value}to the inner<Select>, feeding_valueStorageon every render. Once set,Select._applySelectionByValuelocks the display to the stored string and ignores theselectedattribute on inner options entirely.
Solution
ToolbarSelectOption— revert to plain@property, removing the broken getter/setter. Framework change detection now works correctly.ToolbarSelectTemplate— removevalue={this.value}from inner<Select>. Selection is driven byselectedon inner<Option>elements as rendered by the template.ToolbarSelect:valuesetter: skip forwarding empty string to avoid poisoning_valueStorageon init.valuegetter: read directly from the selected option, no_valueStoragedependency.onBeforeRendering: enforce single-selection (last selected wins), guarded to avoid unnecessary writes that could trigger re-render loops.onAfterRendering: deferred apply for explicitvalue=API only, clears_valueafter applying._syncOptions: clear_valueon user interaction so a prior explicitvalue=assignment does not override the user's choice.
Fixes: #12619
🚀 Deployed on https://pr-13751--ui5-webcomponents-preview.netlify.app