Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit d0d198b

Browse files
committed
fix guide a11y issue
1 parent 1d2eab7 commit d0d198b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/components/guides/GuideFilterCheckbox.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import React from 'react'
44
import { Checkbox } from '../ui/checkbox'
55
import useParams from '@/hooks/useParams'
6+
import { dash } from 'radash'
67

78
interface GuideFilterCheckboxProps {
89
tag: string
@@ -15,7 +16,8 @@ const GuideFilterCheckbox: React.FC<GuideFilterCheckboxProps> = ({ tag }) => {
1516
return (
1617
<div className="flex items-center space-x-4">
1718
<Checkbox
18-
id={tag}
19+
id={dash(tag)}
20+
aria-label={tag}
1921
checked={selectedTags.includes(tag)}
2022
onCheckedChange={(checked) => {
2123
if (checked) {
@@ -32,7 +34,7 @@ const GuideFilterCheckbox: React.FC<GuideFilterCheckboxProps> = ({ tag }) => {
3234
className="h-5 w-5 border-primary-400 data-[state=checked]:bg-primary"
3335
/>
3436
<label
35-
htmlFor={tag}
37+
htmlFor={dash(tag)}
3638
className="cursor-pointer text-base font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
3739
>
3840
{tag}

src/components/guides/GuideMobileFilters.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const GuideMobileFilters: React.FC<GuideMobileFiltersProps> = ({ allTags }) => {
2121
return (
2222
<Dialog>
2323
<DialogTrigger asChild>
24-
<Button variant="outline" size="icon">
24+
<Button variant="outline" size="icon" aria-label="Apply guide filters">
2525
<AdjustmentsHorizontalIcon className="h-6 w-6" />
2626
</Button>
2727
</DialogTrigger>

0 commit comments

Comments
 (0)