Skip to content

Commit a0e2393

Browse files
committed
fix: Move input element out of label since it does not have a widget role
Signed-off-by: Akshat Patel <[email protected]>
1 parent aa1f954 commit a0e2393

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

src/tiles/selection-tile.component.ts

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,30 @@ import {
77
HostListener,
88
AfterViewInit
99
} from "@angular/core";
10-
import { NG_VALUE_ACCESSOR } from "@angular/forms";
1110
import { I18n } from "carbon-components-angular/i18n";
1211

1312
@Component({
1413
selector: "ibm-selection-tile",
1514
template: `
15+
<input
16+
#input
17+
[tabindex]="disabled ? null : 0"
18+
class="bx--tile-input"
19+
[id]="id"
20+
[disabled]="disabled"
21+
[type]="(multiple ? 'checkbox': 'radio')"
22+
[value]="value"
23+
[name]="name"
24+
(change)="onChange($event)"/>
1625
<label
1726
class="bx--tile bx--tile--selectable"
18-
tabindex="disabled ? null : 0"
1927
[for]="id"
2028
[ngClass]="{
2129
'bx--tile--is-selected' : selected,
2230
'bx--tile--light': theme === 'light',
2331
'bx--tile--disabled' : disabled
2432
}"
2533
[attr.aria-label]="i18n.get('TILES.TILE') | async">
26-
<input
27-
#input
28-
tabindex="-1"
29-
class="bx--tile-input"
30-
[id]="id"
31-
[disabled]="disabled"
32-
[type]="(multiple ? 'checkbox': 'radio')"
33-
[value]="value"
34-
[name]="name"
35-
(change)="onChange($event)"/>
3634
<div class="bx--tile__checkmark">
3735
<svg width="16" height="16" viewBox="0 0 16 16">
3836
<path d="M8 16A8 8 0 1 1 8 0a8 8 0 0 1 0 16zm3.646-10.854L6.75 10.043 4.354 7.646l-.708.708 3.104 3.103 5.604-5.603-.708-.708z"

0 commit comments

Comments
 (0)