Replies: 9 comments
-
|
UI-141 [Feature] Async search for `option` and `multiOption` |
Beta Was this translation helpful? Give feedback.
-
|
Async column options is definitely on the internal roadmap. Questions for you:
|
Beta Was this translation helpful? Give feedback.
-
|
Hey, Currently I tested it only with the dev mode. In the seeder I have configured 200 assignees. I assume the delay will increase if there are more (haven't tracked the time, maybe it's just a feeling and I'm the problem 😆) |
Beta Was this translation helpful? Give feedback.
-
|
In our internal project I have integrated https://shadcnui-expansions.typeart.cc/docs/multiple-selector into the react-querybuilder since I had similar problems. Maybe this helps to get an inspiration how to implement it :) |
Beta Was this translation helpful? Give feedback.
-
|
I also notice a delay (~200-250ms) in dev mode. Could you check if the delay is present after |
Beta Was this translation helpful? Give feedback.
-
Hey, tested it quickly and it feels that it's instantly available. No noticable delay. Even with 1000 records in the list, it feels good. I can see a short delay, but it's ok for me ( and the usecase I have ) Update: I also clicked one element from the list, here you can see a "long delay". ( used `pnpm start ) Bildschirmaufnahme.2025-05-12.um.10.00.42.mov |
Beta Was this translation helpful? Give feedback.
-
|
Checked for existing issues in the cmdk package ( since we use it behind the scenes ) and found this one: dip/cmdk#335 maybe the mentioned repo ( using TanStack Virtual ) could help to solve it? Maybe this could be interesting, too? https://shadcn-multi-async-select.vercel.app/ |
Beta Was this translation helpful? Give feedback.
-
Okay, I think this may have to do with how we're handling grouped column options (introduced in v0.2). Let me see if I can optimize the computations for those. For that specific column you're seeing a long delay for, are you using declared or inferred column options?
I'm open to adding a virtualized version as an "add-on" installation from the registry. We can open the discussion to Discord members for feedback. |
Beta Was this translation helpful? Give feedback.
-
I assumed that I have used the I updated the filter definition from: dtf
.multiOption()
.options([])
.id("assignee")
.accessor((row) => row.assignee)
.transformOptionFn((value) => ({
value: value.id,
label: value.name,
icon: undefined,
}))
.displayName("Assigned to")
.build(),to: dtf
.multiOption()
.id("assignee")
.accessor((row) => row.assignee)
.displayName("Assigned to")
.build(),but the result was the same ( after running Ref:
makes sense to me, maybe converting the issue to a discussion? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Do you think it would be possible to have a dynamic/async options generation based on the user input?
Example:
I have a task table which has a many-to-many relation to the assignee table.
Currently, I have to load all assignees and pass the result to the client component which renders the filter.
This works as expected, but open the filter and clicking the field ( in my case it's named as "Assigned to" ), I see a short delay until the list is rendered.
It would be cool if we could provide an option/method to support an "async search" for
optionandmultiOption.What do I mean with "async search"?
By default the options are an empty array, if the user starts typing, a function is called to calculate the options list ( in nextjs, we could use a server action to get the filtered list ) and the user sees just the relevant options.
I think filtering shouldn't be the problem, but tbh I currently have no idea how we could handle the selected values ( since we do not know them ).
Maybe having an additional method to fetch the selected values.
If you have any questions, feel free to ask :)
For the delay, I pushed my latest changes to my repo.
STRs:
Beta Was this translation helpful? Give feedback.
All reactions