Skip to content

Commit 5dca136

Browse files
authored
fix(): Add data attribute to command item classes. (#6)
* fix(): Add data attribute. * fix(): Fix disabled styles. --------- Co-authored-by: aidanCQ <aidan.keay@quantinuum.com>
1 parent 0c6798a commit 5dca136

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/shadcn/ui/command.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ const CommandItem = React.forwardRef<
117117
<CommandPrimitive.Item
118118
ref={ref}
119119
className={cn(
120-
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
120+
'relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50',
121+
props.disabled ? 'opacity-50 pointer-events-none' : '',
121122
className
122123
)}
123124
{...props}

stories/shadcn/command.stories.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const CommandDemo = () => {
4141
</CommandGroup>
4242
<CommandSeparator />
4343
<CommandGroup heading="Settings">
44-
<CommandItem>
44+
<CommandItem disabled >
4545
<PersonIcon className="mr-2 h-4 w-4" />
4646
<span>Profile</span>
4747
<CommandShortcut>⌘P</CommandShortcut>

0 commit comments

Comments
 (0)