Grsmto / simplebar

Custom scrollbars vanilla javascript library with native scroll, done simple, lightweight, easy to use and cross-browser.
http://grsmto.github.io/simplebar/
MIT License
6.02k stars 535 forks source link

Compatibility with react-virtuoso #692

Closed tlthiem closed 4 months ago

tlthiem commented 4 months ago

Looks like quite a few people, me included, are struggling to get simplebar to work with react-virtuoso virtualization library

@Grsmto would you mind taking a look?

The library is providing access to its scroll element via a Scroller components prop

People got it working with "rc-scrollbars" lib.

Given that react-virtuoso is becoming a defacto standard virtualization lib it would be nice to have a reference implementation, if possible.

Grsmto commented 4 months ago

Hi @tlthiem ,

I tried a few things but couldn't find a good way of doing it. It will require Simplebar to mount before react-virtuoso can mount. So there will be a re-render, like in the example provided in the issue you referenced: https://codesandbox.io/p/sandbox/lucid-morning-dkhpgx

tlthiem commented 4 months ago

Alright, thanks for clarifying that there is no better way. Appreciate it!