Skip to content

Commit

Permalink
fix(radio): radio group now has bigger priority when setting value an…
Browse files Browse the repository at this point in the history
…d disabled (#841)
  • Loading branch information
tibing-old-email authored and nnixaa committed Oct 1, 2018
1 parent a7ed638 commit 99acd25
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/framework/theme/components/radio/radio-group.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,19 +137,15 @@ export class NbRadioGroupComponent implements AfterContentInit, OnDestroy, Contr
}

protected updateValues() {
if (this.radios) {
if (this.radios && typeof this.value !== 'undefined') {
this.radios.forEach((radio: NbRadioComponent) => radio.checked = radio.value === this.value);
this.markRadiosForCheck();
}
}

protected updateDisabled() {
if (this.radios) {
this.radios.forEach((radio: NbRadioComponent) => {
if (!radio.hasOwnProperty('disabled')) {
radio.setDisabled = this.disabled
}
});
if (this.radios && typeof this.disabled !== 'undefined') {
this.radios.forEach((radio: NbRadioComponent) => radio.setDisabled = this.disabled);
this.markRadiosForCheck();
}
}
Expand Down

0 comments on commit 99acd25

Please sign in to comment.