Skip to content

Commit

Permalink
fix(module: radio-item-group): fix checked error. (#458) (#463)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anberm authored and fisherspy committed Jun 3, 2019
1 parent eeabc11 commit 0e3ca04
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 5 additions & 2 deletions components/radio/radio-item-group.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,11 @@ export class RadioItemGroupComponent implements AfterContentInit, OnDestroy, Con

updateChildrenStatus() {
if (this.radioItems && typeof (this.selectedValue) !== 'undefined' && null !== this.selectedValue) {
this.radioItems.forEach(radioItem => {
radioItem.checked = radioItem.value === this.selectedValue;
Promise.resolve().then(() => {
this.radioItems.forEach(radioItem => {
radioItem.checked = radioItem.value === this.selectedValue;
radioItem.markForCheck();
});
});
}
}
Expand Down
4 changes: 4 additions & 0 deletions components/radio/radio-item.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,8 @@ export class RadioItemComponent {
this.select$.next(this);
}
}

markForCheck(): void {
this.cdr.markForCheck();
}
}

0 comments on commit 0e3ca04

Please sign in to comment.