fix(forms): select shows blank line when nothing is selected in IE/Edge (#13903)
Closes #10010 PR Close #13903
This commit is contained in:
parent
c5ea03a023
commit
029f558d45
|
@ -86,7 +86,11 @@ export class SelectControlValueAccessor implements ControlValueAccessor {
|
||||||
|
|
||||||
writeValue(value: any): void {
|
writeValue(value: any): void {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
const valueString = _buildValueString(this._getOptionId(value), value);
|
const id: string = this._getOptionId(value);
|
||||||
|
if (id == null) {
|
||||||
|
this._renderer.setElementProperty(this._elementRef.nativeElement, 'selectedIndex', -1);
|
||||||
|
}
|
||||||
|
const valueString = _buildValueString(id, value);
|
||||||
this._renderer.setElementProperty(this._elementRef.nativeElement, 'value', valueString);
|
this._renderer.setElementProperty(this._elementRef.nativeElement, 'value', valueString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue