Skip to content

Commit ef08edc

Browse files
committed
fix(sidebar): correct lock indicator HTML nesting and a11y
1 parent d17b22c commit ef08edc

2 files changed

Lines changed: 16 additions & 6 deletions

File tree

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workflow-list/components/folder-item/folder-item.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,12 +523,17 @@ export function FolderItem({
523523
{folder.locked && (
524524
<Tooltip.Root>
525525
<Tooltip.Trigger asChild>
526-
<span className='-right-[4px] -bottom-[4px] absolute flex h-[12px] w-[12px] items-center justify-center rounded-full bg-[var(--surface-1)]'>
526+
<button
527+
type='button'
528+
aria-label='Folder is locked'
529+
className='-right-[4px] -bottom-[4px] absolute flex h-[12px] w-[12px] items-center justify-center rounded-full bg-[var(--surface-1)] outline-none focus-visible:ring-1 focus-visible:ring-[var(--text-icon)]'
530+
onClick={(e) => e.preventDefault()}
531+
>
527532
<Lock
528533
className='pointer-events-none h-[10px] w-[10px] text-[var(--text-icon)]'
529534
aria-hidden='true'
530535
/>
531-
</span>
536+
</button>
532537
</Tooltip.Trigger>
533538
<Tooltip.Content side='bottom'>
534539
<span>Locked</span>

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workflow-list/components/workflow-item/workflow-item.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ export function WorkflowItem({
432432
onClick={handleClick}
433433
onContextMenu={handleContextMenu}
434434
>
435-
<span className='relative flex-shrink-0'>
435+
<div className='relative flex-shrink-0'>
436436
<div
437437
className='h-[16px] w-[16px] rounded-sm border-[2.5px]'
438438
style={{
@@ -444,19 +444,24 @@ export function WorkflowItem({
444444
{workflow.locked && (
445445
<Tooltip.Root>
446446
<Tooltip.Trigger asChild>
447-
<span className='-right-[4px] -bottom-[4px] absolute flex h-[12px] w-[12px] items-center justify-center rounded-full bg-[var(--surface-1)]'>
447+
<button
448+
type='button'
449+
aria-label='Workflow is locked'
450+
className='-right-[4px] -bottom-[4px] absolute flex h-[12px] w-[12px] items-center justify-center rounded-full bg-[var(--surface-1)] outline-none focus-visible:ring-1 focus-visible:ring-[var(--text-icon)]'
451+
onClick={(e) => e.preventDefault()}
452+
>
448453
<Lock
449454
className='pointer-events-none h-[10px] w-[10px] text-[var(--text-icon)]'
450455
aria-hidden='true'
451456
/>
452-
</span>
457+
</button>
453458
</Tooltip.Trigger>
454459
<Tooltip.Content side='bottom'>
455460
<span>Locked</span>
456461
</Tooltip.Content>
457462
</Tooltip.Root>
458463
)}
459-
</span>
464+
</div>
460465
<div className='min-w-0 flex-1'>
461466
<div className='flex min-w-0 items-center gap-2'>
462467
{isEditing ? (

0 commit comments

Comments
 (0)