Reverse virtual scroll
hello I'm making a chat app with react query and react virtual. To display the messages I need to virtualize the list starting from the bottom with the latest message.
I have implemented a virtual scroll and it work fine to display in the natural order ( top to bottom). To reverse the display I have apply transform with scaleY(-1) to both scroller and items. However now my mouse wheel is reverse.
To counter the reverse mouse whell I have found a snipset on github.
The bad effect of this sollution is that scroll fell laggy by snapping to each scroll position.
Does anyone have implemented a reverse scroll or knows how to counter the laggy effect of my inverted mouse wheell ?
1 Reply
secure-lavender•2y ago
Hey. Did you try adding
{passive:false}
to the wheel handler?
Here's mine code: