pacocoursey / cmdk

Fast, unstyled command menu React component.
https://cmdk.paco.me
MIT License
9.03k stars 258 forks source link

fix(store): Make `getValidItems()` handle missing `CommandList` #246

Closed p6l-richard closed 1 month ago

p6l-richard commented 3 months ago

If one's using CommandItem without a CommandList wrapper (just like in shadcn/ui's Combobox example), the querySelectorAll() returns void. This leads to a TypeError at runtime when called with Array.from(void 0).

This should handle this use case.

vercel[bot] commented 3 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
cmdk-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 5, 2024 0:49am
pacocoursey commented 1 month ago

The List part is required now.