pacocoursey / cmdk

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

Export default filter function from package #197

Open stonix26 opened 7 months ago

stonix26 commented 7 months ago

Does this support react-virtuoso ?

I have created a little demo. It renders properly, but when I try to enter in the input/search field, it fires an error Node.appendChild: Argument 1 is not an object.

https://stackblitz.com/edit/stackblitz-starters-nekqj6?file=src%2FApp.tsx

inokawa commented 6 months ago

Hi, it's not react-virtuoso but https://github.com/inokawa/virtua will work with cmdk. It has similar functionality to react-virtuoso and 3x lighter.

https://inokawa.github.io/virtua/?path=/story/advanced-with-cmdk--default https://github.com/inokawa/virtua/blob/main/stories/react/advanced/With%20cmdk.stories.tsx

kristofdombi commented 2 months ago

You can use it with Virtuoso. you need to disable the default filtering (shouldFilter={false}) and provide a custom filter. See here.

arjendevos commented 1 month ago

@kristofdombi would be nice if the filtering is exported from this package

pacocoursey commented 1 month ago

Agreed, I'll add an export for the defaultFilter. A future version may not ship with a default filter at all, to reduce bundle size.