tajo / react-movable

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

AUTOSCROLL_ACTIVE_OFFSET hardcoded to 200px makes lists that are 200px or less in height erratic while autoscrolling #68

Closed yurigenin closed 8 months ago

yurigenin commented 3 years ago

The List component sets up two areas at the top and the bottom of the list to support autoscrolling while dragging an item. The problem is that the height of those areas is hardcoded to AUTOSCROLL_ACTIVE_OFFSET which 200px. If you have a list that is 200px or less in height and you try to drag an item down the bottom scroll area is never really checked since it is being overlapped by the top scrolling area. So the only way to autoscroll downwards is to drag the item well below the bottom edge of the container which is not intuitive.

This could be solved by allowing to configure the AUTOSCROLL_ACTIVE_OFFSET as a property of the list or at least make it much smaller by default, like 50px instead of 200px.