From 95164311fa3f1b66853393643bd988a864cdfdb3 Mon Sep 17 00:00:00 2001 From: Aaron Schwartz Date: Fri, 12 May 2017 10:42:13 -0700 Subject: [PATCH] Fix default sort algorithm (#268) --- src/defaultProps.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/defaultProps.js b/src/defaultProps.js index d709fb5..58843f6 100644 --- a/src/defaultProps.js +++ b/src/defaultProps.js @@ -32,11 +32,11 @@ export default { }, defaultSortMethod: (a, b) => { // force null and undefined to the bottom - a = (a === null || a === undefined) ? -Infinity : a - b = (b === null || b === undefined) ? -Infinity : b + a = (a === null || a === undefined) ? '' : a + b = (b === null || b === undefined) ? '' : b // force any string values to lowercase - a = a === 'string' ? a.toLowerCase() : a - b = b === 'string' ? b.toLowerCase() : b + a = typeof a === 'string' ? a.toLowerCase() : a + b = typeof b === 'string' ? b.toLowerCase() : b // Return either 1 or -1 to indicate a sort priority if (a > b) { return 1