Skip to content

Commit 9516431

Browse files
aaronschwartztannerlinsley
authored andcommitted
Fix default sort algorithm (TanStack#268)
1 parent 49c5a3d commit 9516431

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/defaultProps.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ export default {
3232
},
3333
defaultSortMethod: (a, b) => {
3434
// force null and undefined to the bottom
35-
a = (a === null || a === undefined) ? -Infinity : a
36-
b = (b === null || b === undefined) ? -Infinity : b
35+
a = (a === null || a === undefined) ? '' : a
36+
b = (b === null || b === undefined) ? '' : b
3737
// force any string values to lowercase
38-
a = a === 'string' ? a.toLowerCase() : a
39-
b = b === 'string' ? b.toLowerCase() : b
38+
a = typeof a === 'string' ? a.toLowerCase() : a
39+
b = typeof b === 'string' ? b.toLowerCase() : b
4040
// Return either 1 or -1 to indicate a sort priority
4141
if (a > b) {
4242
return 1

0 commit comments

Comments
 (0)