-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Combobox - Unhandled Runtime Error TypeError: Array.from requires an array-like object - not null or undefined #3051
Comments
But it can't be click now, but still able to use search and press enter. |
Yeah that's an issue as well. As mentioned in a different thread, the breaking update to cmdk also included "The aria-disabled and aria-selected props will now be set to false, instead of being undefined", which means that the tailwind on the CommandItem needs to be changed to: - "data-[disabled]:pointer-events-none data-[disabled]:opacity-50"
+ "data-[disabled='true']:pointer-events-none data-[disabled='true']:opacity-50" I'll include this in the original post |
I resolved the issue temporarily by downgrading the version. # package.json
- "cmdk": "^1.0.0",
+ "cmdk": "0.2.0", npm install |
Thanks for the suggestion. I just tried with v |
cmdk v1.0.0 has a breaking update:
Currently, the dependency of the Combobox example is: It is not recommended to use |
Hello, I had the same problem with Next.js 14 and I found the following solution:
And now, the Combobox component works. |
This worked perfectly to me, thanks. |
it work perfectly |
Its working for me. thanks |
While downgrading the version of |
Thanks, It's fixed the issue |
Why is this closed as completed? Is #3268 the right PR that's working on this? |
Oh, I just closed it because it has an answer on how to fix it now. Was able to update the OP with the answers as people commented them. Similar to how I might close my issue on StackOverflow once it's been successfully answered. Based on your comment I'm guessing it's supposed to stay open until the fix exists in the actual source code? This is the first github issue I've ever posted. |
Yeah, I think this bug report should stay open until the bug is fixed (which is it not) and the code works as intended. |
None of the fixes—not data-[disabled='true'] or a CMDK downgrade—work. |
@ScottyMaher can you please reopen this? |
This worked for me as well.
This is not needed.
At this point this is not a bug anymore, but it's a misalignment with the documentation. |
Only the downgrade fix worked for me, not the one with
As I am not using the combox, only the "CommandInput"
Event this leads to the Error
Any ideas how to fix this besides downgrading? |
This downgrade is aimed to solve the error: TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator)) arousing from the using popover component of shadcn/ui. For details, see github issues here: shadcn-ui/ui#3051.
Fixed in #2945 |
Describe the bug
In an any Next.js project this is an issue I get simply trying to use the first example combobox as is - copying straight from the docs and without changing anything.
The issue is that the first and last examples do not use a <CommandList> to wrap the <CommandEmpty> and <CommandGroup>. To fix the issue, there must be a CommandList, as the cmdk docs specify.
Here is an excerpt from the first example:
To fix the issue, add CommandList to the imports and change it to this:
The update to cmdk also included "The aria-disabled and aria-selected props will now be set to false, instead of being undefined", which means that the tailwind on the CommandItem also needs to be changed otherwise the mouse events will be disabled on the list:
Affected component/components
Combobox
How to reproduce
Codesandbox/StackBlitz link
No response
Logs
System Info
Before submitting
The text was updated successfully, but these errors were encountered: