Closed ilovett closed 3 months ago
The problem lies in shadcn
, as you said in cmdk
version 1.0.0
they fixed some issues with data-value selector.
In the CommandItem that is created by default come with this classes:
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
You need to remove the data-disabled
related:
data-[disabled]:pointer-events-none
: this one disable all cursor events listening
data-[disabled]:opacity-50
: this one put the text as disabled (only visual efect)
That fixed it, thanks @thelivingchaos
I was introduced to
cmdk
through shadcn, and just upgraded to1.0.0
to fix some withdata-value
selector if it had quotes. That seems to be fixed, but now I have lost the ability to click an item.I can't figure out what's intercepting the click on individual items. Clicking "Enter" works on keyboard, and triggers
onSelect
.Clicking on a
CommandItem
will re-render the whole component, but nothing happens. I cannot get any mouse / onSelect callback to trigger.I've also tried wrapping items with group, and
shouldFilter={false}