Skip to content

fix(useDraggable): fix the problem that dragging element's offset is over the actual offset when there has setup a container #4758

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Stan-BK
Copy link

@Stan-BK Stan-BK commented May 19, 2025

Description

That occur a problem when document has a scroll offset, current dragging element will been setup with a wrong position.
e.g.

2025-05-19.15.47.28.mov

Solution

By calculating the dragging element's position using the document's actual offset, which updates with the window's scroll event.
This is the effect after the fix.

2025-05-19.17.18.38.mov

…over the actual offset when there has setup a container
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant