-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add virtual
prop to Combobox
component
#2740
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
98dd8e1
to
c2e4c99
Compare
7c89273
to
9a00186
Compare
9930ada
to
9a5a33f
Compare
9a5a33f
to
c608896
Compare
Co-authored-by: Jordan Pittman <jordan@cryptica.me>
6f61ab5
to
ef8cd9d
Compare
- Also wrap `click` helpers in `act` for React (use `rawClick` without `act` in tests related to `Transition`)
ef8cd9d
to
a132698
Compare
Hi, Is this virtual feature already implement in last version ? |
@mralexfed007 given that the most recent release was in august, you will have to rely on the insiders build for now. edit: at the time of writing, it is mentioned as an unreleased addition in the CHANGELOG file. |
For anyone stumbling upon this PR, there is a follow up PR with more information and a different approach here: #2779 |
This PR adds a new
virtual
prop to theCombobox
component to improve performance issues by onlyrendering what's visible on the screen.
Behind the scenes the
@tanstack/react-virtual
and@tanstack/vue-virtual
libraries are used to do the heavy lifting.Once the
virtual
prop is in use, it also requires theCombobox.Option
to have anorder
prop. This prop is used to improve internal sorting based on this number instead of sorting by DOM node position.This prop can also be used in a non-virtual
Combobox
version to improve some of the performance.The diff looks like this:
React
Vue
You can play with the virtual examples here:
If you are on a beefy machine, open this up in a browser (like Chrome) where you can slowdown the CPU by 4x or 6x.
Caveats:
virtual
prop, then you won't be able to use thestatic
orunmount={false}
props on the options / option because the goal is to not render items in the DOM.virtual
prop, then theorder
prop on theCombobox.Option
is required.Fixes: #2441