@tanstack/table-core 8.9.1 → 8.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tanstack/table-core",
3
3
  "author": "Tanner Linsley",
4
- "version": "8.9.1",
4
+ "version": "8.9.2",
5
5
  "description": "Headless UI for building powerful tables & datagrids for TS/JS.",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/tanstack/table#readme",
@@ -61,11 +61,18 @@ export function getSortedRowModel<TData extends RowData>(): (
61
61
  const bUndefined = typeof bValue === 'undefined'
62
62
 
63
63
  if (aUndefined || bUndefined) {
64
- return aUndefined && bUndefined
65
- ? 0
66
- : aUndefined
67
- ? columnInfo.sortUndefined
68
- : -columnInfo.sortUndefined
64
+ let undefinedSort =
65
+ aUndefined && bUndefined
66
+ ? 0
67
+ : aUndefined
68
+ ? columnInfo.sortUndefined
69
+ : -columnInfo.sortUndefined
70
+
71
+ if (isDesc && undefinedSort !== 0) {
72
+ undefinedSort *= -1
73
+ }
74
+
75
+ return undefinedSort
69
76
  }
70
77
  }
71
78