Drag-N-Drop source and destination elements
Opened this issue · 0 comments
These elements are used to create drag-n-drop operations in Yarrow.
These elements will contain no styling and will render no primitives.
DragSource
element
This element will contain the following action methods in its builder:
on_drag_start: Option<A>
- emitted when dragging this element has started draggingon_drag_end: Option<A>
- emitted when dragging has finished
This element shall not capture any mouse events until dragging has started. Once dragging has started, it should only capture mouse events if the pointer is currently over the element.
DragTarget
element
This element will contain the following action methods in its builder:
on_pointer_entered: Option<A>
- emitted when the pointer hovers over this element while it is activatedon_pointer_left: Option<A>
- emitted when the pointer leaves this element while it is activatedon_dropped: Option<A>
- emitted when the pointer button is released inside this element while it is activated
By default this element will be inactive. When inactive, the element should mark itself as "hidden" so Yarrow can skip sending any events to it.
Then when the user activates this element via the handle, the element should unhide itself and respond to events. Once the pointer button goes up (or the window becomes unfocused), the element should automatically deactivate itself again.