Skip to content

Commit

Permalink
fix(material): avoid handling focus for selected radio option (#1648)
Browse files Browse the repository at this point in the history
fix #1631
  • Loading branch information
aitboudad committed Jul 5, 2019
1 parent 66239d9 commit 44535ac
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/material/radio/src/radio.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,8 @@ export class FormlyFieldRadio extends FieldType {
};

onContainerClick(event: MouseEvent): void {
if (this.radioGroup._radios.length) {
if (this.radioGroup.selected) {
this.radioGroup.selected.focus();
} else {
this.radioGroup._radios.first.focus();
}
if (this.radioGroup._radios.length && !this.radioGroup.selected) {
this.radioGroup._radios.first.focus();
}
super.onContainerClick(event);
}
Expand Down

0 comments on commit 44535ac

Please sign in to comment.