fix: don't spread dnd-kit attributes onto sortable tab triggers

useSortable's `attributes` (role="button", tabIndex, aria-pressed) were
overriding Radix Tabs.Trigger's own role="tab" and roving-tabindex
management, producing an invalid ARIA tab/role combination that
regressed the accessibility audit. `listeners` alone (onPointerDown /
onKeyDown) is sufficient to drive the drag — the trigger is already a
properly accessible, focusable element.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
nerandClaude Sonnet 4.6 committed 2026-06-06 22:32:06 +03:00
1 parent b31bd062e2
commit dec6560cf0
1 file changed
+1 -2
@@ -27,7 +27,7 @@ const SortableTabsTrigger: FC<{ provider: (typeof providers)[ProviderKey]; isLoa
provider,
isLoading
}) => {
const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({ id: provider.key });
const { listeners, setNodeRef, transform, transition, isDragging } = useSortable({ id: provider.key });
return (
<TabsTrigger
@@ -35,7 +35,6 @@ const SortableTabsTrigger: FC<{ provider: (typeof providers)[ProviderKey]; isLoa
value={provider.key}
style={{ transform: CSS.Transform.toString(transform), transition }}
className={cn('min-h-8 touch-none', isDragging && 'z-10 opacity-50')}
{...attributes}
{...listeners}
>
{isLoading ? <Loader className='animate-spin' size={14} /> : provider.label}