@tanstack/react-table 8.5.21 → 8.5.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2854,19 +2854,30 @@ function filterRowModelFromLeafs(rowsToFilter, filterRow, table) {
2854
2854
  for (let i = 0; i < rowsToFilter.length; i++) {
2855
2855
  var _row$subRows;
2856
2856
  let row = rowsToFilter[i];
2857
+ const newRow = createRow(table, row.id, row.original, row.index, row.depth);
2858
+ newRow.columnFilters = row.columnFilters;
2857
2859
  if ((_row$subRows = row.subRows) != null && _row$subRows.length) {
2858
- const newRow = createRow(table, row.id, row.original, row.index, row.depth);
2859
- newRow.columnFilters = row.columnFilters;
2860
2860
  newRow.subRows = recurseFilterRows(row.subRows);
2861
- if (!newRow.subRows.length) {
2861
+ row = newRow;
2862
+ if (filterRow(row) && !newRow.subRows.length) {
2863
+ rows.push(row);
2864
+ newFilteredRowsById[row.id] = row;
2865
+ newFilteredRowsById[i] = row;
2866
+ continue;
2867
+ }
2868
+ if (filterRow(row) || newRow.subRows.length) {
2869
+ rows.push(row);
2870
+ newFilteredRowsById[row.id] = row;
2871
+ newFilteredRowsById[i] = row;
2862
2872
  continue;
2863
2873
  }
2874
+ } else {
2864
2875
  row = newRow;
2865
- }
2866
- if (filterRow(row)) {
2867
- rows.push(row);
2868
- newFilteredRowsById[row.id] = row;
2869
- newFilteredRowsById[i] = row;
2876
+ if (filterRow(row)) {
2877
+ rows.push(row);
2878
+ newFilteredRowsById[row.id] = row;
2879
+ newFilteredRowsById[i] = row;
2880
+ }
2870
2881
  }
2871
2882
  }
2872
2883
  return rows;
@@ -3293,7 +3304,7 @@ function groupBy(rows, columnId) {
3293
3304
  if (!previous) {
3294
3305
  map.set(resKey, [row]);
3295
3306
  } else {
3296
- map.set(resKey, [...previous, row]);
3307
+ previous.push(row);
3297
3308
  }
3298
3309
  return map;
3299
3310
  }, groupMap);