Skip to content

Commit def3abd

Browse files
fix(sort): treat null values the same as undefined in SortUndefined
1 parent 29a3a32 commit def3abd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/table-core/src/utils/getSortedRowModel.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ export function getSortedRowModel<TData extends RowData>(): (
6161
const aValue = rowA.getValue(sortEntry.id)
6262
const bValue = rowB.getValue(sortEntry.id)
6363

64-
const aUndefined = aValue === undefined
65-
const bUndefined = bValue === undefined
64+
const aUndefined = aValue == null // true for null or undefined
65+
const bUndefined = bValue == null // true for null or undefined
6666

6767
if (aUndefined || bUndefined) {
6868
if (sortUndefined === 'first') return aUndefined ? -1 : 1

0 commit comments

Comments
 (0)