mirror of
https://github.com/material-components/material-web.git
synced 2024-10-26 21:56:56 +03:00
fix(select): ensure md-select selection logic uses fresh DOM references
Previously selectItem would work with cached references to select-option elements which could become stale causing the deactivation logic to fail. This cl just ensures that selectItem always re-fetches the nodes to avoid the issue. PiperOrigin-RevId: 595524158
This commit is contained in:
parent
68b078b4e1
commit
89427158b7
@ -725,7 +725,8 @@ export abstract class Select extends selectBaseClass {
|
||||
* @return Whether the last selected option has changed.
|
||||
*/
|
||||
private selectItem(item: SelectOption) {
|
||||
this.lastSelectedOptionRecords.forEach(([option]) => {
|
||||
const selectedOptions = this.getSelectedOptions() ?? [];
|
||||
selectedOptions.forEach(([option]) => {
|
||||
if (item !== option) {
|
||||
option.selected = false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user