Closed Subwaytime closed 1 year ago
Just to clarify, do you refer to whether it's the handle, if handle or handles are provided? Or the whole element if no handle?
Glad you find this library useful, always open to improving it :)
Hmm good question, i think it would be great if its always the dragged element, so if there is a handle include the handle otherwise the dragged element. It might be worth to check if there is a handle then get the parent element? Not sure, as it could be nested quite deeply.. Maybe get the element that v-draggable
is attached too, that should give enough options to work with!
Yeah the library works quite well :) Great work here! :+1:
I am thinking of this API surface
{
currentTarget: HTMLElement // The actual element which is being dragged
target: HTMLElement // The element being dragged, but either its the root node or one of the handles.
targetType: 'root' | 'handle'
}
currentTarget
: The element on which the cursor was. Could be a child element of the root node, could be the node itself. Will give the precise element which triggered the dragging
target
: It's the root node, on which v-draggable was applied. target
can either be the root node or a handle node only, not a child element.
targetType
: root
. No need to explain
currentTarget
: Same as the above scenario. Gives the exact element which triggered dragging
target
: It is one of the handles. Notice, it returns only one handle element, in case an array was provided or there just are multiple selectors for handle
option
targetType
: handle
What do you think of this API surface?
That looks great!
Sorry for the delay, I'll add it to the 2.0 release. I have already added a node
property internally in the event returned, I'll add this to the release
No worries! Havent had the time to be working with the library anyways on said project.. :sweat_smile:
Any ETA for the 2.0 release?
When docs are done
So no idea 😅
It's been implemented
Hey there! Currently trying out neodrag to replace sortablejs, as i find it far more enjoyable and more responsive! :) Atm i am not 100% sure, whats the best way to get the currently dragged element (as a DomElement) or the dropzone..
Maybe it might be worth to add this directly to the eventData ?