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

MultipleContainers jitter from inner item when dragging to bottom of new column #1080

Open
brettinternet opened this issue Mar 24, 2023 · 2 comments

Comments

@brettinternet
Copy link

brettinternet commented Mar 24, 2023

I have reconstructed the multiple containers example:

https://codesandbox.io/s/dndkit-ivpj4d

When moving an inner container to the bottom of a different column, I'm experiencing some jitter from an existing inner item at the bottom of the column just as the dragged item is carried to the new column.

Watch "C4" in this video:

Screen.Recording.2023-03-23.at.9.47.47.PM.mov

In a local project:

Screen.Recording.2023-03-23.at.9.32.09.PM.mov

It appears subtle in this video, but it appears more pronounced in different examples. Does anyone know what might be causing this jitter?

@akantic
Copy link

akantic commented Mar 30, 2023

I noticed the same behaviour when I've added more logic to my draggable items.

I did some debugging and I think what happens is that the vertical sorting strategy first adds the item as next to last, then quickly moves it to the last spot when the state updates with the item in new container. As of now, I have no solution except to try and simplify my draggable items when dragging something.

In this video, first I have the full item and you can see how it jitters when changing containers. Then, I comment out the menu code (button with 3 vertical dots, which contains plenty of logic) inside the draggable item and the jitter is gone.

recording.mp4

@brettinternet
Copy link
Author

I think you're right, it's probably related to the vertical sort or the collision strategy. I also noticed the keyboard's programmatic move will move the item to the next-to-last in the next column as well, and refuses to move it to the last item, even if it's lower on the previous column's list.

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

No branches or pull requests

2 participants