Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add tab navigation to single tile component #6

Merged
merged 3 commits into from
Oct 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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