fix: allow for null values in HTML select options bound with ngValue
This corrects the case of <option [ngValue]="null"> binding a string like "{0: null}" to the model instead of an actual null object. Closes #10349
This commit is contained in:
parent
79e2bb9291
commit
d90b622fa4
|
@ -115,8 +115,8 @@ export class SelectControlValueAccessor implements ControlValueAccessor {
|
|||
|
||||
/** @internal */
|
||||
_getOptionValue(valueString: string): any {
|
||||
const value = this._optionMap.get(_extractId(valueString));
|
||||
return value != null ? value : valueString;
|
||||
let key: string = _extractId(valueString);
|
||||
return this._optionMap.has(key) ? this._optionMap.get(key) : valueString;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue