[BUG] Offset between the cursor and the dragged element when the page is scrolled down
See original GitHub issue1. 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:
- Go to the code sandbox link above.
- Scroll to the bottom of the page
- Drag any of the rectangles up.
- 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:
- Created 2 years ago
- Reactions:3
- Comments:6
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@WNemencha I ended up using react-beautiful-dnd
Fixed in 5 https://codesandbox.io/s/drag-layout-flicker-forked-evrzk?file=/src/App.tsx