Forcing render on specific Items 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
Uh oh!
There was an error while loading. Please reload this page.
-
I am using
cmdkas 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 somecmdkgroups (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=falsebehaviour except only for specific items or groups.Having looked through the code, I think that the
renderfunctions (inItemandGroup) decides whether to show the item or not. I think adding aforceRenderboolean 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