Closed GeorgThomassen closed 8 months ago
This is related to ComandEmpty
of shadcn/ui.
I found a solution in cmdk issue #149
open Command.tsx
and replace the CommandEmpty
to following snippet
const CommandEmpty = React.forwardRef<
HTMLDivElement,
React.ComponentProps<typeof CommandPrimitive.Empty>
>(({ className, ...props }, forwardedRef) => {
const render = useCommandState((state) => state.filtered.count === 0);
if (!render) return null;
return (
<div
ref={forwardedRef}
className={cn('py-6 text-center text-sm', className)}
cmdk-empty=""
role="presentation"
{...props}
/>
);
});
When you pick all the options the EmptyIdenticator is shown:
However, when clicking the component again the EmptyIdenticator is not shown:
It seems like the CommandEmpty is not kicking in