This commit is contained in:
tannerlinsley 2019-06-11 11:41:07 -06:00
commit 289dca1caf

View File

@ -22,7 +22,7 @@ const propTypes = {
columns: PropTypes.arrayOf(
PropTypes.shape({
sortByFn: PropTypes.func,
efaultSortDesc: PropTypes.bool
defaultSortDesc: PropTypes.bool
})
),
sortByFn: PropTypes.func,
@ -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'