Skip to content

Commit

Permalink
fix(radio-button, circle-toggle): add tabindex="-1" to label element …
Browse files Browse the repository at this point in the history
…in radio groups (#1340)

The tabindex is necessary that on focusout events the relatedTarget gets set properly in browsers.
  • Loading branch information
[email protected] authored and GitHub Enterprise committed Sep 30, 2024
1 parent 9d190ed commit e3ada6b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
(keydown.enter)="handleEnterKey($event)"
(click)="toggle($event)"
/>
<label class="nx-circle-toggle__label" [for]="id + '-input'" [id]="id + '-label'">
<label class="nx-circle-toggle__label" [for]="id + '-input'" [id]="id + '-label'" tabindex="-1">
<nx-icon-toggle-button
[label]="label"
[hint]="hint"
Expand Down
2 changes: 1 addition & 1 deletion projects/ng-aquila/src/radio-button/radio-button.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
[attr.aria-disabled]="disabled || readonly || null"
class="nx-radio__input"
/>
<label [id]="labelId" [attr.for]="inputId" class="nx-radio__label" [class.has-label]="labelHasContent">
<label [id]="labelId" [attr.for]="inputId" tabindex="-1" class="nx-radio__label" [class.has-label]="labelHasContent">
<div class="nx-radio__circle">
@if (checked) {
<div class="nx-radio__dot"></div>
Expand Down

0 comments on commit e3ada6b

Please sign in to comment.