diff --git a/packages/table-core/src/utils/getSortedRowModel.ts b/packages/table-core/src/utils/getSortedRowModel.ts index eb5e9d5729..3c1246f9fa 100644 --- a/packages/table-core/src/utils/getSortedRowModel.ts +++ b/packages/table-core/src/utils/getSortedRowModel.ts @@ -61,8 +61,8 @@ export function getSortedRowModel(): ( const aValue = rowA.getValue(sortEntry.id) const bValue = rowB.getValue(sortEntry.id) - const aUndefined = aValue === undefined - const bUndefined = bValue === undefined + const aUndefined = aValue == null // true for null or undefined + const bUndefined = bValue == null // true for null or undefined if (aUndefined || bUndefined) { if (sortUndefined === 'first') return aUndefined ? -1 : 1