From 5b0e68aead1cf616d62bcdb9fb4fd0e614a1ca79 Mon Sep 17 00:00:00 2001 From: Dmitrii Gaidarji Date: Fri, 31 May 2019 22:17:58 +0900 Subject: [PATCH 1/2] Fix defaultSortDesc blocking toggle action (#1341) * Fix defaultSortDesc blocking toggle action * Revert "Fix defaultSortDesc blocking toggle action" This reverts commit 15e05cefd820e3f63e80a8e9d31b9431f295b55a. * Fix defaultSortDesc blocking toggle action --- src/hooks/useSortBy.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hooks/useSortBy.js b/src/hooks/useSortBy.js index 4e0f905..90a66b1 100755 --- a/src/hooks/useSortBy.js +++ b/src/hooks/useSortBy.js @@ -82,7 +82,8 @@ export const useSortBy = props => { if (!multi) { if (sortBy.length <= 1 && existingSortBy) { - if (existingSortBy.desc) { + if ((existingSortBy.desc && !resolvedDefaultSortDesc) || + (!existingSortBy.desc && resolvedDefaultSortDesc)) { action = 'remove' } else { action = 'toggle' From c6167566da54c56773cfb246cc115f3afc26ef8a Mon Sep 17 00:00:00 2001 From: Hellycat Date: Fri, 31 May 2019 16:18:26 +0300 Subject: [PATCH 2/2] Fix misspelled in propTypes (#1353) --- src/hooks/useSortBy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/useSortBy.js b/src/hooks/useSortBy.js index 90a66b1..997be6f 100755 --- a/src/hooks/useSortBy.js +++ b/src/hooks/useSortBy.js @@ -22,7 +22,7 @@ const propTypes = { columns: PropTypes.arrayOf( PropTypes.shape({ sortByFn: PropTypes.func, - efaultSortDesc: PropTypes.bool + defaultSortDesc: PropTypes.bool }) ), sortByFn: PropTypes.func,