Wrong top calculation for scroll ancestors with fixed position?
See original GitHub issueHi there, we’re using the library to create a dnd experience between a scrollable fixed position div and a sortable ( scrollable ) drop zone. This mostly works well ( we’re currently using PR #54 as our basis ) but causes our DragOverlay to appear in the wrong top position after scrolling the drop zone.
Below is an example based on the sandbox shown in #43
https://codesandbox.io/s/react-dnd-grid-forked-gls5l?file=/src/App.js
We made a change to check whether an element ancestor is fixed in getScrollableAncestors
, which causes only that ancestor to be returned ( Obviously, this is just a small demo and doesn’t deal with more complex scenarios / performance etc.)
This makes the following return the expected value for our scenario https://github.com/clauderic/dnd-kit/blob/d13d28471ec7716f08e211647cad89ae3c11dd06/packages/core/src/utilities/rect/getRect.ts#L82-L84
Issue Analytics
- State:
- Created 3 years ago
- Reactions:12
- Comments:12 (3 by maintainers)
Has there been any fixes for this bug?
For anyone googling this error: The fix has been released in @dnd-kit/core 4.0.0.