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:
gary-b
2016-11-01 22:43:13 +00:00
committed by Victor Berchet
parent 124267c87a
commit b3dcff0cc1
2 changed files with 36 additions and 30 deletions

View File

@ -99,6 +99,7 @@ export class SelectMultipleControlValueAccessor implements ControlValueAccessor
}
}
}
this.value = selected;
fn(selected);
};
}