Description
Describe the bug
When utilizing a Command component that has been added/updated as of 03/07/2024 ~6PM PST, items cannot be clicked and are disabled. (Additionally some examples using command in the docs are incorrect)
Additionally, <CommandItem>
s that are not surrounded by a <CommandList>
will crash the application and upon opening the Command component, the error: TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
will be thrown.
This is due to cmdk making a new release with breaking changes: https://github.com/pacocoursey/cmdk/releases
Workaround
This can be fixed by pinning cmdk version to 0.2.1 in package.json
See #2944 (comment)
Solution
#2944 (comment) for disabled items fix
#2944 (comment)
for error fix
Please see PR #2945 to fix these issues
Affected component/components
Command
How to reproduce
- Run
npx shadcn-ui@latest add command
after 03/07/2024 - Try to use command component
Codesandbox/StackBlitz link
Logs
No response
System Info
cmdk v1.0.0
Before submitting
- I've made research efforts and searched the documentation
- I've searched for existing issues