Skip to content

Commit

Permalink
fix: bug in sortData subRows (#2541)
Browse files Browse the repository at this point in the history
Fix sort subRows stop recursion when subRows length is one.
If row.subRows length is one, the subRows of row.subRows[0] will not sort in recursion
  • Loading branch information
leyinetwork authored Jul 20, 2020
1 parent 744bff4 commit 9676c8f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/plugin-hooks/useSortBy.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ function useInstance(instance) {
// If there are sub-rows, sort them
sortedData.forEach(row => {
sortedFlatRows.push(row)
if (!row.subRows || row.subRows.length <= 1) {
if (!row.subRows || row.subRows.length < 1) {
return
}
row.subRows = sortData(row.subRows)
Expand Down

1 comment on commit 9676c8f

@vercel
Copy link

@vercel vercel bot commented on 9676c8f Jul 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.