daybrush / moveable

Moveable! Draggable! Resizable! Scalable! Rotatable! Warpable! Pinchable! Groupable! Snappable!
https://daybrush.com/moveable/
MIT License
10.08k stars 618 forks source link

Drop container in the drop event? #226

Closed GKatsarov closed 4 years ago

GKatsarov commented 4 years ago

Environments

Description

I've been using the library for a month now, I've tested all the events, inputEvent, target, everything, I still cant manage to get the container in which I drop the element. The thing I do is very easy. I have a div inside my main container, 50% top, 50% height, and the element at the top of the container. I try to move the element inside the div, drop it, and I can't get the div in any way. Please help!

daybrush commented 4 years ago

I cannot provide a drop event.

Instead, hitTest method can be used to test drop the container.

moveable.hitTest(dropContainer: element | { left, top, width, height }): number;
GKatsarov commented 4 years ago

I cannot seem to find any function hitTest in the moveable library. I've even checked the

https://daybrush.com/moveable/release/latest/dist/moveable.min.js

for references and still nothing. Can you provide an example or anything, that I can use, for the current version of the library? Thanks a lot in advance!

daybrush commented 4 years ago

@GKatsarov oh. sorry. i'll add this method.

daybrush commented 4 years ago

@GKatsarov

moveable's new version is released.

Check hitTest method. Thank you :)