Closed steffanek closed 1 month ago
Would not providing a loadingIndicator
solve the problem?
Would not providing a
loadingIndicator
solve the problem?
Unfortunately no @hsuanyi-chou
If you want filter locally, all you have to do is to build the Option type(which is { value: string; label: string; disable?: boolean; fixed?: boolean; [key:string]: string | undefined; }
) and send to the defaultOptions
or options
prop.
cmdk
will do the rest.
If you want filter locally, all you have to do is to build the Option type(which is
{ value: string; label: string; disable?: boolean; fixed?: boolean; [key:string]: string | undefined; }
) and send to thedefaultOptions
oroptions
prop.
cmdk
will do the rest.
@hsuanyi-chou That's what I did in the beginning. But you can only pass one full list in defaultOptions
. So when the user click the multi-select (focus on) it will display the list of 1000 items.
And my use case is the following:
If your case doesn’t need to send a request, you can simply remove the debounce and the loading state code to make it become a sync filter.
All the code is in your project, not in node_modules.
@hsuanyi-chou yes I know and I tried to make this behavior based on your component, but there is plenty of logic, and could not figure it out what exactly I need to remove.
Would not be better if there was a props to make such behavior available for everyone? I can see its a popular features to have such suggested default options list when the multi-select focus is triggered.
@hsuanyi-chou works perfectly, many thanks! Btw are you on discord?
Yes, I am on discord. Here
Feature description
I have 2 arrays that match the
Option
shape locally. Those arrays are hold bypossibleOptions
object (see below themockSearch
fn):triggerSearchOnFocus
meaning when user click on the multiselect or the search.value is empty.When I'm using the async
onSearch
with a followingmockSearch
function withdelay = 0
or by passing the propdelay={0}
, I still see a debounce:When I have options locally, I should be able to have a UX without a debounce, so the result almost appear instantly. Perhaps its about bypassing the Debounce? What you think @hsuanyi-chou ? Thanks in advance!
Affected component/components
No response
Additional Context
Additional details here...
Before submitting