fix(forms): ensure select[multiple] retains selections
If you bound an array to select[multiple] via ngModel and subsequently changed the options to select from, the UI would drop any selections made since by the user. This was due to SelectMultipleControlValueAccessor not keeping a reference to the new model arrays it generated when users interacted with the select control. Update code to keep the reference. Closes #12527 Closes #12654
This commit is contained in:
@ -99,6 +99,7 @@ export class SelectMultipleControlValueAccessor implements ControlValueAccessor
|
||||
}
|
||||
}
|
||||
}
|
||||
this.value = selected;
|
||||
fn(selected);
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user