-
-
Notifications
You must be signed in to change notification settings - Fork 646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve auto-scrolling for small containers / large drag sources #23
Comments
@horprogs that's one of the manifestations of the issue, indeed. On how this could be improved: Generally I think it's a bit tricky to find a one-size-fits-all strategy for auto-scrolling. I think in the future this should be a bit more extensible, and have either a pointer coordinates based strategy or a strategy that is based on the bounding rect of the dragged element |
@clauderic Looking the grid example, I wonder if the auto-scrolling is too aggressive. Right now it seems that the page auto-scrolls when the element is brought down past the halfway point of the page. A simple solution might be to only scroll if the element that is being dragged is nearing the edge of the viewport. Any thoughts? |
Having similar issues but with on drag instantly scrolling to the top in a scrollable container. |
I don't know if this is related to this issue but when you try to scroll with dragged element without DragOverlay element position won't be updated for the scroll duration. You can see it here: https://5fc05e08a4a65d0021ae0bf2-vfebfgjygq.chromatic.com/?path=/docs/presets-sortable-grid--without-drag-overlay Drag element and try to scroll the page with it. Result: mouse position and element position are different. |
I'm running into this issue as well - has anyone found an interim workaround? |
I'm working on a fix to these issues here: #140 |
I am using dnd-Kit and sortable, context with an array. In my case auto scrolling is not working in a list while item being dragged. |
Currently if you have a small scroll container and a large drag source, it's nearly impossible to get fine controlled auto-scrolling working properly given the existing auto-scrolling logic.
The getScrollDirectionAndSpeed will need to be updated to take into account the relative size of the item being dragged compared to the scroll container's actual size
The text was updated successfully, but these errors were encountered: