clauderic / clauderic/react-sortable-hoc
Mouse position when dragging after hiding multiple elements prevents scrolling
- Dominant language
- JavaScript
- Stars
- 10.9k
- Forks
- 959
- PR merge metrics
- No merged PRs in 30d
Description
When hiding elements after triggering the drag action (While using multiple element selection, for example: https://github.com/clauderic/react-sortable-hoc/tree/master/src/.stories/grouping-items) on an element that is near the last position in the selected elements list or just below items that need to be hidden (when not using multiple selection), the mouse position does not get updated to where the dragged item is at; this prevents the user from scrolling if the space taken by the elements that were hidden after starting the drag action is bigger than the space remaining in the window.
You can see in the gif that I ran out of space in the window so I cannot keep moving the mouse down for the auto-scrolling to be triggered.

On my use case a workaround is to use the mousewheel, but this doesn't always work and it's not as ideal as auto-scrolling.
I tried updating the SortableHelper's DOM node `top` attribute while tracking the position of the mouse, but this breaks the rendering of the list by leaving a blank space on the original spot where the element was and where the element is dropped. I'm guessing it's because the `node` argument we get in many of the helper functions can't get its position (`top` attribute in this case) updated. Is there any other way to get around this? This bug is preventing me from using it in production.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.