Get item on drag ui.list

Hello!

I have ui.list with drag one item, not multiselect.

item before Drop have index example= 5

//code
onAfterDrop:function(context, e){

//new Item index after drop, example = 2. Good.
console.log(context.index);

// Get index this item by Id
$$('filesPhotosEdit').files.getIndexById(context.start);
// this return OLD item index  = 5


//This coder too return OLD item indexes 
Object.entries($$('filesPhotosEdit').files.data.pull).forEach(function(item, i, arr) {
    idF = item[0];
    console.log($$('filesPhotosEdit').files.getIndexById(idF));
});

}

Why he return OLD item indexes ? How i get new item indexes?

@Kossin
can you share a snippet?
in this one your code is working as expected
https://snippet.webix.com/yf0v78e5

Your code work good. I change all “$$(‘filesPhotosEdit’).files” to “this” and my code work all good!

“$$(‘filesPhotosEdit’).files.getIndexById(idF)” to “this.getIndexById(idF)”

Excellent!!! Thanks @intregal !