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
d90b622fa4
commit
b55aaf094f
|
@ -121,8 +121,8 @@ export class SelectMultipleControlValueAccessor implements ControlValueAccessor
|
|||
|
||||
/** @internal */
|
||||
_getOptionValue(valueString: string): any {
|
||||
const opt = this._optionMap.get(_extractId(valueString));
|
||||
return opt ? opt._value : valueString;
|
||||
let key: string = _extractId(valueString);
|
||||
return this._optionMap.has(key) ? this._optionMap.get(key)._value : valueString;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue