Closed desiboli closed 7 months ago
Downgrading to "cmdk": "^0.2.1"
works.
Same issue here!
Should be resolved by changing the disabled related classes within CommandItem
Before:
data-[disabled]:pointer-events-none data-[disabled]:opacity-50
After:
disabled:pointer-events-none disabled:opacity-50
Example.
const CommandItem = React.forwardRef<
React.ElementRef<typeof CommandPrimitive.Item>,
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>
>(({ className, ...props }, ref) => (
<CommandPrimitive.Item
ref={ref}
className={cn(
"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 disabled:pointer-events-none disabled:opacity-50",
className
)}
{...props}
/>
))
Should be resolved by changing the disabled related classes within
CommandItem
Before:
data-[disabled]:pointer-events-none data-[disabled]:opacity-50
After:
disabled:pointer-events-none disabled:opacity-50
Example.
const CommandItem = React.forwardRef< React.ElementRef<typeof CommandPrimitive.Item>, React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item> >(({ className, ...props }, ref) => ( <CommandPrimitive.Item ref={ref} className={cn( "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 disabled:pointer-events-none disabled:opacity-50", className )} {...props} /> ))
It fixes my problem. Thanks a lot!
Also related #3024
Describe the bug
Using the latest cmdk component with cmdk version 1.0.0 is not working properly, the dialog opens as usual but you cannot select or hover an item.
Affected component/components
Command
How to reproduce
Setup new Astro project with shadcn ui and add the Command component.
Codesandbox/StackBlitz link
https://stackblitz.com/edit/withastro-astro-1dtsvr?file=src%2Fstyles%2Fglobals.css
Logs
No response
System Info
Before submitting