Skip to content
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

Jitter when autoscrolling to the end of a list #764

Closed
tristan-shelton opened this issue Aug 27, 2018 · 16 comments
Closed

Jitter when autoscrolling to the end of a list #764

tristan-shelton opened this issue Aug 27, 2018 · 16 comments

Comments

@tristan-shelton
Copy link

Bug or feature request?

Bug report

Expected behavior

Draggables of different sizes should be able to be dropped with autoscroll

Actual behavior

When dropping a larger draggable in a list of smaller ones, there's a pronounced jitter at the end of the list that makes dropping as the last item difficult.

Steps to reproduce

Create two vertical drag drop lists with overflow scroll, one with taller items than the other. Drag a taller item to the bottom of the list of smaller items.

dnd-bug

What version of React are you using?

16.3.1

What version of react-beautiful-dnd are you running?

9.0.1

What browser are you using?

Chromium 68
Also appears to happen with Chrome 68, IE11 and Edge 41

Demo

Demo forked from the official demo:
https://codesandbox.io/s/481n1nzvm7

@alexreardon
Copy link
Collaborator

Thanks for raising this. I will take a look today

@alexreardon
Copy link
Collaborator

I think I have found the cause - and it is messy! In order to fix this I need to do some big refactors. Rather than put this into master, I will target next as it already has a number of improvements in this area.

This should go out in version 10

@alexreardon
Copy link
Collaborator

I have created a fix for this 🎉

It is now a part of #719 and will ship with that.

Thanks for raising this @tristan-shelton!!! 👏

This fix should go to production in the next few weeks

@alexreardon
Copy link
Collaborator

auto-scroll-fix

I still need to update and write new tests but I will do that on #719

@alexreardon
Copy link
Collaborator

The space the placeholder makes snaps the list up. But this should be fixed in #77

@tristan-shelton
Copy link
Author

Wow, thanks so much for taking care of it so quickly! That one was really giving me headaches trying to implement the library.

Great work!

@GeorgeMarcusGG
Copy link

GeorgeMarcusGG commented Nov 2, 2018

I had a similar issue where this happens on a container with overflow: auto and max-height. It works when the container is scrolling (lots of items), but it doesn't when it's not (few items). This is on [email protected] (but same on [email protected]). My current workaround will probably be setting the overflow manually (either scroll or visible) depending on the number of items. Any better suggestions?

@alexreardon
Copy link
Collaborator

alexreardon commented Nov 3, 2018 via email

@GeorgeMarcusGG
Copy link

I tried it on [email protected] and it doesn't work. This is a similar setup to mine https://codesandbox.io/s/94kmmkv564 (ugly, I know) - gif.

@alexreardon
Copy link
Collaborator

alexreardon commented Nov 4, 2018 via email

@alexreardon
Copy link
Collaborator

It should be fixed now on [email protected]

@alexreardon
Copy link
Collaborator

@GeorgeMarcusGG
Copy link

@alexreardon Hey, I don't want to be a pain in the ass, but this doesn't quite seem fixed for me. I adapted your code, so you can see what I mean.

Lots of items - the spacing is fine, but jitter is there: code, gif (the gif does not show the jitter, but it's there)

Few items - spacing not quite the same: code, gif

@arkist
Copy link

arkist commented Nov 12, 2018

@GeorgeMarcus It seems because of overflow: 'auto' on your getListStyle.
if you change to overflowY: 'hidden', overflowX: 'auto' instead, jitter will gone.

@alexreardon
Copy link
Collaborator

Closed by #838. See version 10 release notes

@JackHull
Copy link

This error still remains on the newest react-beautiful-dnd version (13.1.0) and react 17.0.2.
Please reopen.
All the above tips did nothing for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants