Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
Check,
Clipboard,
ExternalLink,
Info,
} from 'lucide-react'
import { useParams } from 'next/navigation'
import { Button, Input, Label, Tooltip } from '@/components/emcn/components'
Expand Down Expand Up @@ -249,6 +250,18 @@ const renderLabel = (
<Label className='flex items-baseline gap-1.5 whitespace-nowrap'>
{config.title}
{required && <span className='ml-0.5'>*</span>}
{config.tooltip && (
<Tooltip.Root>
<Tooltip.Trigger asChild>
<span className='inline-flex'>
<Info className='h-3 w-3 flex-shrink-0 cursor-pointer text-muted-foreground' />
</span>
Comment on lines +255 to +258
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Tooltip trigger is not keyboard-accessible

The <span> wrapping the Info icon has no tabIndex or role, so keyboard-only users cannot reach the tooltip. Radix UI requires a focusable element as the trigger to work correctly with keyboard navigation. Adding tabIndex={0} and role="button" (or swapping for a <button>) would make it accessible.

Suggested change
<Tooltip.Trigger asChild>
<span className='inline-flex'>
<Info className='h-3 w-3 flex-shrink-0 cursor-pointer text-muted-foreground' />
</span>
<span className='inline-flex' tabIndex={0} role='button' aria-label={config.tooltip}>

Note: the existing AlertTriangle tooltip uses the same pattern, so this is a pre-existing gap rather than a regression introduced by this PR.

</Tooltip.Trigger>
<Tooltip.Content side='top'>
<p>{config.tooltip}</p>
</Tooltip.Content>
</Tooltip.Root>
)}
{labelSuffix}
{config.type === 'code' &&
config.language === 'json' &&
Expand Down
Loading