Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Commit bf8f1fa

Browse files
authored
fix(select): Should update value asynchronously (#1642)
Fixes #1638
1 parent 1d52c8e commit bf8f1fa

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/select/select.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ let nextUniqueId = 0;
9393
class="mdc-select__native-control"
9494
[attr.aria-describedby]="_ariaDescribedby || null"
9595
[required]="required"
96+
[value]="value"
9697
(mousedown)="onInteraction($event)"
9798
(touchstart)="onInteraction($event)"
9899
(blur)="onBlur()"
@@ -200,7 +201,7 @@ export class MdcSelect extends _MdcSelectMixinBase implements AfterViewInit, DoC
200201
@Input()
201202
get value(): any { return this._value; }
202203
set value(newValue: any) {
203-
this.setSelectionByValue(newValue);
204+
this.setSelectionByValue(newValue, true);
204205
}
205206
private _value: any;
206207

@@ -411,7 +412,7 @@ export class MdcSelect extends _MdcSelectMixinBase implements AfterViewInit, DoC
411412
}
412413

413414
writeValue(value: any): void {
414-
this.setSelectionByValue(value, false);
415+
this.setSelectionByValue(value);
415416
}
416417

417418
registerOnChange(fn: (value: any) => void): void {
@@ -456,7 +457,7 @@ export class MdcSelect extends _MdcSelectMixinBase implements AfterViewInit, DoC
456457
* Sets the selected option based on a value. If no option can be
457458
* found with the designated value, the select trigger is cleared.
458459
*/
459-
setSelectionByValue(value: any, isUserInput: boolean = true): void {
460+
setSelectionByValue(value: any, isUserInput?: boolean): void {
460461
if (!this._foundation) { return; }
461462

462463
const newValue = value || null;

0 commit comments

Comments
 (0)