tajo / react-movable

🔀 Drag and drop for your React lists and tables. Accessible. Tiny.
https://react-movable.pages.dev
MIT License
1.53k stars 51 forks source link

Provide option to disable auto-scrolling #91

Closed xionluhnis closed 2 months ago

xionluhnis commented 1 year ago

Thank you so much for creating such minimal version of a drag-n-drop list for react.

Would it be possible to have a parameter to disable the auto-scrolling behavior?

Context

There are issues with smaller component heights, but also small "draggable" items whose drag-n-drop is not stable enough to be used in some scenarios without a detrimental experience.

Related

Different perspective

I understand that auto-scroll is a nice feature to have -- if it works. But since it doesn't always work, being able to disable it would be great.

My use case scenarios don't involve moving items very far in the list even though the list can be long. This suggests that I don't need auto-scroll, yet having it enabled right now makes the drag-n-drop hazardous.

I need the scrolling to be possible, but not done automatically when dragging items.

Using transitionDuration={0} helps in making the whole behavior more reasonable, but it's still not sufficient in some scenarios where a small element ends up being scrolled down very far in a short period of time.

tajo commented 1 year ago

If anyone wants to add & document it, I'm fine with an opt-out.

IanVS commented 2 months ago

@xionluhnis auto-scroll should be much improved in the latest versions of react-movable. I wonder if you would consider giving it another try and see if you no longer need to disable it.