Forcing render
on specific Item
s or disabling filter for specific groups
#62
Closed
mrmartineau
started this conversation in
Ideas
Replies: 3 comments 2 replies
-
I would like this too! |
Beta Was this translation helpful? Give feedback.
0 replies
-
Let's do it! If you're open to submitting a PR @mrmartineau I'd be happy to review. Let's call the prop |
Beta Was this translation helpful? Give feedback.
2 replies
-
Fixed in #101 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using
cmdk
as a way to search and navigate my app. In most cases I'd like to use the built-in filtering that provided with the package, but for somecmdk
groups (as I have them), I'd like to not use the built-in filtering and instead show them based on an API response from my app's search endpoint - it's kind of like theshouldFilter=false
behaviour except only for specific items or groups.Having looked through the code, I think that the
render
functions (inItem
andGroup
) decides whether to show the item or not. I think adding aforceRender
boolean prop would solve the issue on both those elements. Would that be the right way to go about it?const render = useCmdk((state) => + forceRender ? true : context.filter() === false ? true : !state.search ? true : state.filtered.groups.has(id) )
I'm happy to submit a PR for the changes, but wanted to see if there was already a way to do it
Beta Was this translation helpful? Give feedback.
All reactions