atlassian / react-beautiful-dnd

Beautiful and accessible drag and drop for lists with React
https://react-beautiful-dnd.netlify.app
Other
33.18k stars 2.53k forks source link

Allow setting of auto scroll config #1205

Open shruti8789 opened 5 years ago

shruti8789 commented 5 years ago

Still in very early stages of fiddling around. But it is fun to play with!

early-auto-scroll

@alexreardon Here, we can see a definite area after which it starts to auto-scroll (both above and down the pane/palette) . Can we customize this area?

Originally posted by @shruti8789 in https://github.com/atlassian/react-beautiful-dnd/issues/27#issuecomment-477559715

alexreardon commented 5 years ago

What is the use case you are trying to support? Do you think there is something wrong with the existing logic? Could we improve it?

alexreardon commented 5 years ago

It feels like this issue is getting at a problem in thinking about how we auto scroll.

Here are the values we use to control auto scroll behaviour:

https://github.com/atlassian/react-beautiful-dnd/blob/master/src/state/auto-scroller/fluid-scroller/config.js

angellindo commented 5 years ago

@alexreardon is there a way to adjust those values to be precise the startFromPercentage

shruti8789 commented 5 years ago

@alexreardon, If you try to drag a task outside this definite area (at the start or end of the tasks visible), as soon as you will pick the task the pane will start scrolling. Problem: If you pick a task from below the area defined after which we start scrolling, it will automatically starts to scroll down, even if the intention of the user was to drag it upwards.

angellindo commented 5 years ago

@shruti8789 that is correct and that is what I'm trying to avoid or reduce.

alexreardon commented 5 years ago

Perhaps we could expose a way to expose the auto scroll config