Skip to content

Support for Virtualization #246

@usman-web-dev

Description

@usman-web-dev

Thank you for this amazing library. It's hands down the best free open-source selection tool we've come across. We really appreciate the efforts put into it!

Is your feature request related to a problem? Please describe.
We're running into issues when using viselect in a virtualized grid. The core problem is that the library internally manages its own selection store, which doesn't persist when elements are unmounted due to virtualization. As a result, items are immediately unselected once they scroll out of view, even if we attempt to restore selection state on our end when they re-render.

Describe the solution you'd like
We'd like viselect to better support virtualization by decoupling selection state store. Ideally, the library could expose an external selection store (or allow plugging one in), so we can manage selection across unmounts ourselves. Alternatively, a hook or event system that allows us to intercept selection changes and preserve them externally would help too.

Describe alternatives you've considered
We've tried manually saving selection state and restoring it when virtualized items re-render, but viselect unselects those items as soon as they leave the visible DOM, making this workaround ineffective. There doesn't appear to be a reliable way to persist selection state across unmounts with the current API.

Additional context
This feature is essential for integrating viselect with libraries like react-window, react-virtualized or react-virtuoso, which unmount off-screen DOM nodes for performance. Having virtualization support would greatly increase the use cases viselect can serve.

Thanks again for maintaining such a high-quality library, we're excited to keep using it and would love to see it support even more advanced use cases like this!

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions