question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Offset between the cursor and the dragged element when the page is scrolled down

See original GitHub issue

1. Describe the bug

When dragging an element with drag={true} prop set, and the page scrolled down at the same time, the dragged element will be rendered lower than the cursor by the amount of scroll down.

2. IMPORTANT: Provide a CodeSandbox reproduction of the bug https://codesandbox.io/s/drag-layout-flicker-forked-sf8jz

3. Steps to reproduce Steps to reproduce the behavior:

  1. Go to the code sandbox link above.
  2. Scroll to the bottom of the page
  3. Drag any of the rectangles up.
  4. Observe the offset between the cursor and the dragged rectangle in the process of dragging.

5. Expected behavior

I expect the rectangle to be positioned under the cursor in the same way it was when I started dragging itl

6. Environment details

Artix Linux, Firefox 89 (64 bit)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:6

github_iconTop GitHub Comments

github_iconTop Results From Across the Web

jQuery draggable shows helper in wrong place after page ...
If I try and drag a draggable element here, the element appears above my mouse cursor the same amount of pixels as I've...
Read more >
Drag'n'Drop with mouse events - The Modern JavaScript Tutorial
If elements are dragged to top/bottom window edges – the page scrolls up/down to allow further dragging. There is no horizontal scroll (this ......
Read more >
Issue when scrolling down the page and dragging an element
Issue when scrolling down the page and dragging an element ... When you scroll down a page and then drag an element, the...
Read more >
Dragging a draggable element out of a scrollable div - GSAP
I'm buidling a scrollable bar at the top of the page (which kan be hidden/shown). That bar contains draggable elements that will be...
Read more >
Cursor position on draggable element - CSS-Tricks
Attached below is simple jQuery function for dragging elements. Everything works as intended, with one exception…the position of the mouse ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found