Sortable icon indicating copy to clipboard operation
Sortable copied to clipboard

How to move to a new index inside onChange, while dragged

Open ghost opened this issue 2 years ago • 0 comments

I am looking to do something like that:

onChange: function (evt) {
          if (evt.newIndex === 0) {
            evt.newIndex = 14
          }
          if (evt.newIndex > 3 && evt.newIndex < 7) {
             evt.newIndex = 12
          }
        }

The ghost should follow the new index.

Note: inside onChange, I see the sortable object but I don't see the sortable.ghost. Is there a method inside .ghost to move the element?

ghost avatar May 22 '23 12:05 ghost