petyosi / react-virtuoso

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

Usage of a useWindowScroll prop in integrating with react-beautiful-dnd #390

Closed dmitryTurov closed 3 years ago

dmitryTurov commented 3 years ago

Describe the bug Errors while dragging an item: Invariant failed: Cannot collect without a droppable ref Invariant failed: Cannot stop drag when no active drag

Reproduction https://codesandbox.io/s/usage-of-a-usewindowscroll-prop-in-integrating-with-react-beautiful-dnd-390-rm72r

To Reproduce Drag an item

Desktop:

dmitryTurov commented 3 years ago

Hello! Thanks for your work first of all @petyosi! Obviously, I didn't get the main realization idea of wrapping the list into a document scroll container. If you have any suggestions on this case I would be extremely grateful

petyosi commented 3 years ago

What you have linked is just a blank sandbox. I assume you tried to combine the existing examples with useWindowScroll, but likely this needs more tweaks in the config of dnd. Using window scrolling with beautiful dnd would be a useful example indeed, I would love to get a contribution on the matter.

dmitryTurov commented 3 years ago

Thanks for the reply! Sorry, you are right I provided a broken link. Updated. In fact, you are right twice: it was just a copy of the example (https://virtuoso.dev/react-beautiful-dnd/) but with enabled useWindowScroll prop. If I make it work with some workaround I'll ping you

exneval commented 3 years ago

I think I've found the workaround, kindly check this PR #397

github-actions[bot] commented 3 years ago

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

The release is available on:

Your semantic-release bot :package::rocket: