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

@dnd-kit/react (beta). Wrong nested scrollable elements activating #1429

Closed
AddMoreScripts opened this issue Jun 10, 2024 · 8 comments
Closed

Comments

@AddMoreScripts
Copy link

AddMoreScripts commented Jun 10, 2024

Greetings!
Thank you for publishing the experimental beta-branch in npm.
I want to use @dnd-kit/react for kanban-board. But I encountered a bug.

I have one DragDropProvider and several nested scrollable elements with draggables located inside them (useDraggable({...})).
When I start dragging the first element, everything works well, autoscroll works correctly.

But if then I start dragging an element from another container, the first container will still scroll.
Is this a bug? or am I doing something wrong?
I am attaching a video demonstration:

2024-06-10.22-07-26.mp4
@clauderic
Copy link
Owner

Which version are you using? I've released several beta versions under the beta tag on npm

https://www.npmjs.com/package/@dnd-kit/react?activeTab=versions

@AddMoreScripts
Copy link
Author

@clauderic screen recorded on 0.0.2-beta-20240610024106
I just saw the new beta version. Perhaps this bug is no longer there?

@clauderic
Copy link
Owner

That's a relatively recent version so likely still a bug. Can you create a small replication case in CodeSandbox or similar so I can investigate?

@AddMoreScripts
Copy link
Author

@clauderic, yes, sure:

https://codesandbox.io/p/sandbox/dnd-kit-beta-gxm2lk?file=%2Fsrc%2FApp.tsx

@clauderic
Copy link
Owner

It's fixed now:
https://codesandbox.io/p/sandbox/dnd-kit-beta-forked-yymnjq?file=%2Fpackage.json%3A9%2C24

Fixed by this commit:
1483a9f

Available in the latest beta release:
0.0.2-beta-20240610193339

Let me know if you run into any other issues with the beta packages :)

@AddMoreScripts
Copy link
Author

@clauderic
Thank you.
I updated my version too. Unfortunately, scrolling now stops when the dragged element goes beyond the border of a scrollable div, whereas previously it continued at maximum speed in this case. But I think that my request is very specific, it may be very difficult to implement.

@clauderic
Copy link
Owner

I pushed a small tweak to the auto scroller that should make this behave more like most consumers would expect, try it out and let me know what you think.

@AddMoreScripts
Copy link
Author

its work perfect, thankyou.

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