dnd-kit icon indicating copy to clipboard operation
dnd-kit copied to clipboard

Final `ClientRect` coordinates for active draggable `null` in `onDragEnd` event handler

Open alspdx opened this issue 3 years ago • 8 comments

As mentioned in this discussion, it would be relevant to know the final location of the active draggable in the onDragEnd handler for calculating absolute position. Before on the onDragEnd event handler is invoked the values for event.active.rect.current.initial and event.active.rect.current.translated are set to null, and location must be tracked using the onDragMove handler.

@clauderic suggested that this is a bug and should be re-opened as an issue.

Thanks!

alspdx avatar Apr 27 '21 22:04 alspdx

Is there any update on this issue, or an alternative way to calculate the final location of the active draggable element?

marbiano avatar Nov 15 '21 14:11 marbiano

Access to the final coordinates of active would be really useful!

KevinMusgrave avatar Aug 08 '22 06:08 KevinMusgrave

I'm having the same problem

seunggs avatar Aug 11 '22 04:08 seunggs

Same problem here

lennartguth avatar Sep 23 '22 15:09 lennartguth

Any update on this issue? I am seeing this behavior in OnDragStart and OnDragOver as well in version 6.0.8.

lironbenjamin avatar May 04 '23 14:05 lironbenjamin

Same problem at version 6.1.0.

I'm implementing multiple containers sorting and I think I need the active.rect to known if it's dropping over or below the target.

PabloCorso avatar Apr 24 '24 20:04 PabloCorso