When I move a task from a column to another column, I need the new position/index of the task in the targetColumn and I need to make an async api call based on that. As there's only one async dnd listener (beforeTaskDrop) - I need the data in this listener.
I see that I get the data in taskDrop from targetColumn.tasks, but as this is not an async listener, it doesn't help me.
I also noticed that if I console targetColumn in beforeTaskDrop, it shows updated tasks under the object, but if I console targetColumn.tasks it shows the old data.
console.log('targetColumn', targetColumn); // this shows 25 tasks under tasks element
console.log('-------');
console.log('targetColumn.tasks', targetColumn.tasks); // this shows 24 tasks
beforeTaskDrop triggers before task drop, so operation is not complete at this moment. This is async method where you can validate operation, show confirmation dialog or whatever you need and when this method return true or at least not Boolean false, operation will be finished.
I would not expect to have new position in beforeTaskDrop, when operation has not been finished. But I am not sure what did you mean in "position".