You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As I understand it from reading the documentation, and some trial-and-error, it appears that the evt object passed to the onMove() function includes the evt.related property, providing a nice reference to the list item over which the dragged item is dragging.
I would find it even more useful if the evt object passed to the onEnd() and onChange() functions - called when dragging has finally ended and the list order has actually changed, I believe - so that the onEnd() and onChange() functions were to have a very nice reference to the item that was required to move in order to allow the dragged item to take its place.
One could say that evt.newIndex would help. Is it guaranteed that evt.newIndex + 1 is the index of the item that was moved? Perhaps not if the evt.newIndex is at the end of the list. But maybe that's okay, I guess you can test for that. Perhaps I should bring this up in a Discussion thread instead?
Anyway, a reference to the related (passively moved) item would be fantastic. To me it would be far more useful than the evt.related reference that is passed to onMove().
Perhaps better than using than using newIndex to use the DOM to get the correct child element in the list. It would seem to me that Sortable would already have a reference to the item in order to move it.
The text was updated successfully, but these errors were encountered:
As I understand it from reading the documentation, and some trial-and-error, it appears that the evt object passed to the onMove() function includes the evt.related property, providing a nice reference to the list item over which the dragged item is dragging.
I would find it even more useful if the evt object passed to the onEnd() and onChange() functions - called when dragging has finally ended and the list order has actually changed, I believe - so that the onEnd() and onChange() functions were to have a very nice reference to the item that was required to move in order to allow the dragged item to take its place.
One could say that evt.newIndex would help. Is it guaranteed that evt.newIndex + 1 is the index of the item that was moved? Perhaps not if the evt.newIndex is at the end of the list. But maybe that's okay, I guess you can test for that. Perhaps I should bring this up in a Discussion thread instead?
Anyway, a reference to the related (passively moved) item would be fantastic. To me it would be far more useful than the evt.related reference that is passed to onMove().
Perhaps better than using than using newIndex to use the DOM to get the correct child element in the list. It would seem to me that Sortable would already have a reference to the item in order to move it.
The text was updated successfully, but these errors were encountered: