petyosi / react-virtuoso

The most powerful virtual list component for React
https://virtuoso.dev
MIT License
5.25k stars 301 forks source link

ScrollSeekPlaceholder not working well with logitech mx master #288

Closed RanST-dev closed 3 years ago

RanST-dev commented 3 years ago

I have a Logitech MX Master mouse with a fast scroll option, as well as a Logitech MX Anywhere mouse with the same feature.

When I scroll really fast and stop suddenly, the list will be stuck with placeholders. If I scroll again slowly it will be updated and show the component defined in itemContent prop. I guess it has something to do with debouncing of on scroll event, but I am not sure.

Is there any way to fix it?

It happens with the example: https://virtuoso.dev/scroll-seek-placeholders/

Screenshot: image

petyosi commented 3 years ago

I don't have access to such a device, so I am not sure what's going on. You can easily run the project locally and throw some breakpoints in the code - this is the system in question. If you are interested in doing that and need some help, let me know - I will reopen the ticket.

psirenny commented 3 years ago

I don't think this is device specific. I encounter the same problem with an Apple mouse. For me, it seems I often have stray enter callbacks fire after the exit callback. I've observed this in my project but haven't created a reproducable example.

vnesterovspirent commented 3 years ago

This behavior is reproduced with a usual mouse, are there any solutions to this problem?

petyosi commented 3 years ago

@vnesterovspirent are you willing to debug it and submit a PR? As guidance, this is the code that handles scroll seek logic:

https://github.com/petyosi/react-virtuoso/blob/master/src/scrollSeekSystem.ts

vnesterovspirent commented 3 years ago

Thanks for the hint, I will try to figure this out.

github-actions[bot] commented 3 years ago

:tada: This issue has been resolved in version 1.8.5 :tada:

The release is available on:

Your semantic-release bot :package::rocket: