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

fix(useDraggable): drag element relative to parentNode instead of Window #3219

Closed
wants to merge 2 commits into from

Conversation

cunzaizhuyi
Copy link
Contributor

Fixed #3199

Now the dragged element can be dragged relative to parentNode instead of Window.

@cunzaizhuyi cunzaizhuyi changed the title fix: useDraggable fix(useDraggable): drag element relative to parentNode instead of Window Jul 9, 2023
@3aluw
Copy link

3aluw commented Jul 14, 2023

Hi, I can see the idea behind the proposed solution. But I'm not sure it works on all situations.
I created a meeting seating plan and I got a weird behavior; items are moving in opposite vertical directions when the drag starts.
I hope you can check this on the vueuse playground and try to move different items vueuse playground OR demo 2

@cunzaizhuyi
Copy link
Contributor Author

@3aluw I made some changes to the code, and it can make your example run successfully.

Copy link

@3aluw 3aluw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I think it would work well with most use cases.
Can you affirm that it works with local scrolls like this one playground ?

@stale
Copy link

stale bot commented Sep 13, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

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

Successfully merging this pull request may close these issues.

The absolute/relative positioning makes the useDraggable element change its coordinates as moving starts
2 participants