Add Drag In and Drag Out events by roy-mdr · Pull Request #2198 · SortableJS/Sortable

added 2 commits

September 2, 2022 14:09
Leaved comments in this commit for code review before merge.

known isues:
- DnD HTML5 API: If drag too fast to another browser UI element (ej. dev tools) the HTML5 DnD dragLeave event is not triggered (not an issue from this code) ... a workaround could be to force a fallback to get the element at pointer position when dragging back to the browser window.
Before: dragIn event was only triggered when it was a valid list to drop in. However if the list was nested in another Sortable the event didn't fire again because it was already marked as valid.
After: dragIn event is triggered even if is not a valid Sortable to drop in. Now is up to the Sortable component to handle and check if the list is allowed to drop in.

@roy-mdr

onDrop event is triggered when a sortable-dragging element is dropped inside the X and Y of the Sortable element, even if there was no onEnd event triggered

@roy-mdr

@roy-mdr

@roy-mdr