DataTableFacetedFilter is disabled #2976
-
I have replicated the concepts of the Tasks example in my own repo. Everything is working well, except for the Any idea what I could be doing wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Hi there, I encountered the same issue. It appears that there's a problem with the shadcn's Command.tsx component, which is utilized in the DataTableFacetedFilter as you mentioned. Upon examining Command.tsx, you'll notice an import of something labeled as command from 'cmdk', and this seems to be the root cause of the issue. "A temporary solution that worked for me is to adjust the npm version in the package.json file as follows: |
Beta Was this translation helpful? Give feedback.
-
Hi there, I too encountered the same issue, and after some investigating I think I found the culprit. I don't think it have anything to do with the cmdk, but with the Command.tsx file provided. More specifically on the CommandItem component. Following what @sadmann7 have done in his implementation of shadncn-table, the issue seem to be in the classname ; changing from : 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 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
className
)}
{...props}
/>
)) to : 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 data-[disabled='true']:pointer-events-none data-[disabled='true']:opacity-50",
className
)}
{...props}
/>
))` Fixed the issue for me even tho I can't yet explain it as I m not that knowledgeable on the |
Beta Was this translation helpful? Give feedback.
-
Hello, I implemented a similar feature, but in my case, I also want an "ALL" filter. This filter should display all records, including those with statuses of pending, processing, success, and failed. When the "ALL" option is selected, it should display all records regardless of their status. Thank you! |
Beta Was this translation helpful? Give feedback.
Hi there, I too encountered the same issue, and after some investigating I think I found the culprit.
I don't think it have anything to do with the cmdk, but with the Command.tsx file provided. More specifically on the CommandItem component. Following what @sadmann7 have done in his implementation of shadncn-table, the issue seem to be in the classname ; changing from :