Closed wasimsandhu closed 1 week ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
marimo-docs | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jun 21, 2024 2:24am |
marimo-storybook | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jun 21, 2024 2:24am |
After wrestling with @tanstack/react-virtual
for a few hours, using Virtuoso was surprisingly easy.
Installed react-virtuoso
and passed <Virtuoso />
to <Combobox />
.
It broke cmdk
filtering since the <ComboboxItem>
components are wrapped in the virtuoso element:
TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.
The cmdk
FAQ recommends implementing filtering on your own for virtualization anyway, so that's what I did.
Tested multiselect on my own machine and it's buttery smooth now -- did not spot any regressions.
I did see that <Combobox>
is used in switchable-multi-select
and form.tsx
-- I did not get a chance to do regression tests for those.
awesome work @wasimsandhu!
📝 Summary
Completes #588.
🔍 Description of Changes
Installed
[react-virtuoso](https://github.com/petyosi/react-virtuoso)
and passed<Virtuoso />
to<Combobox />
.Because
cmdk
does not support filtering with virtualization, I used the existing filter function inMultiselectPlugin.tsx
to filter the options array directly.📋 Checklist
📜 Reviewers
@mscolnick