Skip to content

Commit 3bf6705

Browse files
authored
feat: add tab navigation to single tile component (#6)
1 parent 9911f55 commit 3bf6705

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

resources/assets/css/_components.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@
337337
}
338338

339339
.tile-selection-single {
340-
@apply relative py-4 border-2 cursor-pointer select-none rounded-xl border-theme-primary-100 transition-default;
340+
@apply relative py-4 border-2 cursor-pointer select-none rounded-xl border-theme-primary-100 transition-default outline-none focus:ring-2 focus:ring-theme-primary-500;
341341
}
342342

343343
.tile-selection-option:hover,

resources/views/inputs/includes/tile-selection-option.blade.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ class="flex relative flex-col"
1010
<label
1111
dusk="tile-selection-label-{{ $option['id'] }}"
1212
for="{{ $id.'-'.$option['id'] }}"
13-
wire:key="tile-selection-option-{{ $id.'-'.$option['id'] }}"
13+
@if ($single)
14+
tabindex="0"
15+
x-on:keydown.space.prevent="$event.target.querySelector('input').click()"
16+
@endif
1417
@class([
1518
'tile-selection-single' => $single,
1619
'tile-selection-option' => ! $single,
@@ -26,6 +29,7 @@ class="flex relative flex-col"
2629
>
2730
@if ($single)
2831
<input
32+
tabindex="-1"
2933
id="{{ $id.'-'.$option['id'] }}"
3034
name="{{ $id }}"
3135
type="radio"

0 commit comments

Comments
 (0)