I have got a list of Customers (Image1- unsorted) and displaying this list in a table. Users able to sort this table by clicking table header.
If they click Customer Name the first time (Image2), the List is sorted by Customer Name from A-Z Then they click the Customer Name a second time (Image3), List sorted by Customer Name from Z-A
The issue is, when the user clicks the Customer Name the third time (Image4), I was expecting to see the list reordered like the first time(Image 2). But it is not. The list is ordered A-Z, but it is not in the same order As you can see from the images i attached Second Image and 3rd image orders are not the same order.
if (this.orderByColSide)
authList.sort((a, b) => a.customerCode.toLowerCase() > b.customerCode.toLowerCase() ? 1 : -1);
else
authList.sort((a, b) => a.customerCode.toLowerCase() > b.customerCode.toLowerCase() ? -1 : 1);



