We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 25aff1a commit 5a5568aCopy full SHA for 5a5568a
src/components/table/sort.ts
@@ -2,7 +2,7 @@ export function descendingComparator<T>(a: T, b: T, orderBy: keyof T, order: Sor
2
// first attempt to parse into a numeric value and compare
3
const numCompare = descendingNumComparator(a, b, orderBy);
4
if (numCompare !== null) {
5
- return numCompare;
+ return order === 'desc' ? numCompare : numCompare * -1;
6
}
7
8
// if non-numeric, compare using the javascript built-in compare for this type
0 commit comments