@tanstack/table-core 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.
@@ -2846,19 +2846,30 @@
2846
2846
  for (let i = 0; i < rowsToFilter.length; i++) {
2847
2847
  var _row$subRows;
2848
2848
  let row = rowsToFilter[i];
2849
+ const newRow = createRow(table, row.id, row.original, row.index, row.depth);
2850
+ newRow.columnFilters = row.columnFilters;
2849
2851
  if ((_row$subRows = row.subRows) != null && _row$subRows.length) {
2850
- const newRow = createRow(table, row.id, row.original, row.index, row.depth);
2851
- newRow.columnFilters = row.columnFilters;
2852
2852
  newRow.subRows = recurseFilterRows(row.subRows);
2853
- if (!newRow.subRows.length) {
2853
+ row = newRow;
2854
+ if (filterRow(row) && !newRow.subRows.length) {
2855
+ rows.push(row);
2856
+ newFilteredRowsById[row.id] = row;
2857
+ newFilteredRowsById[i] = row;
2858
+ continue;
2859
+ }
2860
+ if (filterRow(row) || newRow.subRows.length) {
2861
+ rows.push(row);
2862
+ newFilteredRowsById[row.id] = row;
2863
+ newFilteredRowsById[i] = row;
2854
2864
  continue;
2855
2865
  }
2866
+ } else {
2856
2867
  row = newRow;
2857
- }
2858
- if (filterRow(row)) {
2859
- rows.push(row);
2860
- newFilteredRowsById[row.id] = row;
2861
- newFilteredRowsById[i] = row;
2868
+ if (filterRow(row)) {
2869
+ rows.push(row);
2870
+ newFilteredRowsById[row.id] = row;
2871
+ newFilteredRowsById[i] = row;
2872
+ }
2862
2873
  }
2863
2874
  }
2864
2875
  return rows;
@@ -3285,7 +3296,7 @@
3285
3296
  if (!previous) {
3286
3297
  map.set(resKey, [row]);
3287
3298
  } else {
3288
- map.set(resKey, [...previous, row]);
3299
+ previous.push(row);
3289
3300
  }
3290
3301
  return map;
3291
3302
  }, groupMap);