Skip to content

Commit

Permalink
Revert "refactor(radio-group): use delegatesFocus"
Browse files Browse the repository at this point in the history
This reverts commit a8a10f9.
  • Loading branch information
benelan committed Dec 15, 2022
1 parent 0e0e1f9 commit a3c8158
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/components/radio-group/radio-group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ import {
@Component({
tag: "calcite-radio-group",
styleUrl: "radio-group.scss",
shadow: {
delegatesFocus: true
}
shadow: true
})
export class RadioGroup
implements LabelableComponent, FormComponent, InteractiveComponent, LoadableComponent
Expand Down Expand Up @@ -264,7 +262,8 @@ export class RadioGroup
@Method()
async setFocus(): Promise<void> {
await componentLoaded(this);
this.el.focus();

(this.selectedItem || this.getItems()[0])?.focus();
}

//--------------------------------------------------------------------------
Expand All @@ -286,7 +285,7 @@ export class RadioGroup
//--------------------------------------------------------------------------

onLabelClick(): void {
this.el.focus();
this.setFocus();
}

private getItems(): NodeListOf<HTMLCalciteRadioGroupItemElement> {
Expand Down

0 comments on commit a3c8158

Please sign in to comment.