Skip to content

Commit

Permalink
feat: add tab navigation to single tile component (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
alfonsobries authored Oct 8, 2021
1 parent 9911f55 commit 3bf6705
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion resources/assets/css/_components.css
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@
}

.tile-selection-single {
@apply relative py-4 border-2 cursor-pointer select-none rounded-xl border-theme-primary-100 transition-default;
@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;
}

.tile-selection-option:hover,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ class="flex relative flex-col"
<label
dusk="tile-selection-label-{{ $option['id'] }}"
for="{{ $id.'-'.$option['id'] }}"
wire:key="tile-selection-option-{{ $id.'-'.$option['id'] }}"
@if ($single)
tabindex="0"
x-on:keydown.space.prevent="$event.target.querySelector('input').click()"
@endif
@class([
'tile-selection-single' => $single,
'tile-selection-option' => ! $single,
Expand All @@ -26,6 +29,7 @@ class="flex relative flex-col"
>
@if ($single)
<input
tabindex="-1"
id="{{ $id.'-'.$option['id'] }}"
name="{{ $id }}"
type="radio"
Expand Down

0 comments on commit 3bf6705

Please sign in to comment.