The PR fulfills these requirements: (check all the apply)
[x] It's submitted to the main branch.
[x] When resolving a specific issue, it's referenced in the PR's title (e.g. feat: Add a button #xxx, where "xxx" is the issue number).
[x] When resolving a specific issue, the PR description includes Closes #xxx, where "xxx" is the issue number.
[x] If changes were made to ui folder, unit tests (make test) still pass.
[x] New/updated tests are included
The problem was in reducer inside onSortChange function
setFilteredItems(filteredItems => [...groups]
// sorts groups by startIndex to match its order in filteredItems
.sort((group1, group2) => group1.startIndex - group2.startIndex)
.reduce((acc, group) => [...acc, ...filteredItems.slice(group.startIndex, acc.length + group.count).sort(sortingF(column, sortAsc))],
[] as any[]) || [])
adding acc.length + group.count filtered items into the final array even in case of empty group present (group.count equal to 0) but acc.length having non-zero value most of the time.
The PR fulfills these requirements: (check all the apply)
main
branch.feat: Add a button #xxx
, where "xxx" is the issue number).Closes #xxx
, where "xxx" is the issue number.ui
folder, unit tests (make test
) still pass.The problem was in reducer inside
onSortChange
functionadding
acc.length + group.count
filtered items into the final array even in case of empty group present (group.count
equal to0
) butacc.length
having non-zero value most of the time.Fixed by conditional adding of items:
Closes #2268