-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Virtualize QueryList items #2632
Comments
@frabarz this is precisely what |
Oh also you'll need to be on 2.x or ideally 3.0 for this |
@adidahiya Thoughts on re-opening this? Using a custom |
Might consider https://github.com/clauderic/react-tiny-virtual-list for this |
I agree this not being trivial. I'm having issues using https://codesandbox.io/s/p3j721n57m I believe it's something to do with the renderSelectList = ({
items,
itemsParentRef, // do i need this??
renderItem,
}: {
items: Films.IFilm[],
itemsParentRef: (ref: HTMLElement | null) => void,
renderItem: (item: any, index: number) => JSX.Element | null,
}) => {
return (
<VirtualList
width="100%"
height={400}
itemCount={items.length}
itemSize={20} // Also supports variable heights (array or function getter)
renderItem={({ index, style }) => renderItem(items[index], index)}
/>
);
}; |
@gianpaj Would a |
Hi @cmslewis , thanks for that but actually the CSS is not the only issue. Check the example: https://codesandbox.io/s/p3j721n57m That's my guess anyway |
I think you're right, as I'm having a similar problem with a different virtualized list library. Many of the virtualized/window libraries work by setting absolute positions on the elements in the list as you scroll. (This blank list effect is a very common scenario) Because the I've got something working here, but the styling is a bit off. |
@saruman1234 That helped a lot. Thanks for sharing. |
Environment
Feature request
It would be great to have the
Select
list elements, or theQueryList
for that matter, be virtualized to let it handle very long lists.Examples
I wanted to use
Select
to handle a list with ~1400 elements, with just aspan
inside, and as it renders all the items the list takes a good while to appear and filter. I ended up piecing something withreact-tiny-virtual-list
andPopover2
, but without a bunch of the capabilities ofSelect
.The text was updated successfully, but these errors were encountered: