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

[BUG] Draggable area incorrectly reduced after page scroll and refresh #2829

Open
SaeWooKKang opened this issue Oct 11, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@SaeWooKKang
Copy link
Contributor

SaeWooKKang commented Oct 11, 2024

1. Read the FAQs πŸ‘‡
βœ…
2. Describe the bug

When applying dragConstraints with a ref (position: absolute, top, left, bottom, right: 0), the behavior is as follows:

Without scrolling, the draggable element can move freely within the entire viewport area. However, after scrolling, the draggable element is constrained to move only within the viewport area minus the scrolled height.

3. IMPORTANT: Provide a CodeSandbox reproduction of the bug

https://stackblitz.com/edit/vitejs-vite-gdmqjk?file=src%2FApp.tsx

4. Steps to reproduce

  1. Navigate to the provided link.
  2. Without scrolling, verify that you can drag the element to all corners (left, right, top, and bottom) of the viewport.
  3. Scroll the page.
  4. Refresh the page.
  5. Attempt to drag the element and verify that you cannot move it to the bottom of the viewport anymore.

5. Expected behavior

Even when the page is scrolled, the element should be draggable to the bottom of the viewport.

6. Video or screenshots

drag.mov

7. Environment details

mac 15, chrome

@SaeWooKKang SaeWooKKang added the bug Something isn't working label Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant