Closed EternallLight closed 4 years ago
Looks great!
Regarding the tests, I haven't found any of them for beforeDrag in the existing codebase, so I haven't written tests for new callbacks. Let me know if you find them necessary.
That would nice. There should be tests for all public APIs. For beforeDrag
there is at least an example (dynamic table), but yea, if you could add some e2e tests for beforeDrag
, afterDrag
and onMove
that would appreciated!
if you could add some e2e tests for
beforeDrag
,afterDrag
andonMove
that would appreciated!
Okay, will take a look at this next week. Thanks for the review
Closing for inactivity. Feel free to re-open.
Hi @tajo,
Here the commit with changes from issue #20.
I called the new callback
afterDrag
as you suggested so that it matches to the existingbeforeDrag
. It is called right beforeonChange
and contains the new index of the dragged element.Both
beforeDrag
andafterDrag
callbacks are now the ClientRect object. Since, we can't access the ghostRef when beforeDrag is called, I'm returning the ClientRect of the original DOM element.Also, added
onMove
callback. I haven't implemented its triggered when list elements are moved with keyboard shortcuts as it contains the mouse coordinates and they are not quite relevant when moving the items with keyboard.Regarding the tests, I haven't found any of them for
beforeDrag
in the existing codebase, so I haven't written tests for new callbacks. Let me know if you find them necessary.Thanks, Andrey