here I want to clear those rows by pressing and selecting the DeleteRow button, the problem is that if I select rows from the top of the list, they will be removed without problems, but if the rows are from Selection down to top, selected rows cannot be deleted.
handleMultipleDelete = () =>{
const arr=this.state.selectRowList;
const product = this.state.productList;
for (let i=arr.length-1; i>=0; i-- ){
product.splice(arr[i], 1);
}
this.setState({
productList: product,
selectRowList: [],
});
}
My code is here