Skip to content

Commit

Permalink
bug fix (#843)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Sheryak authored Apr 20, 2021
1 parent 7ed61e9 commit 38d6267
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/components/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1332,6 +1332,7 @@ export default {
// or as a result of modifying rows.
this.columnFilters = columnFilters;
let computedRows = JSON.parse(JSON.stringify(this.originalRows));
let instancesOfFiltering = false;
// do we have a filter to care about?
// if not we don't need to do anything
Expand Down Expand Up @@ -1373,6 +1374,8 @@ export default {
for (let i = 0; i < this.typedColumns.length; i++) {
const col = this.typedColumns[i];
if (this.columnFilters[fieldKey(col.field)]) {
instancesOfFiltering = true;
computedRows.forEach((headerRow) => {
const newChildren = headerRow.children.filter((row) => {
// If column has a custom filter, use that.
Expand Down Expand Up @@ -1402,7 +1405,12 @@ export default {
}
}
}
this.filteredRows = computedRows.filter((h) => h.children && h.children.length);
if (instancesOfFiltering) {
this.filteredRows = computedRows.filter((h) => h.children && h.children.length);
} else {
this.filteredRows = computedRows;
}
},
getCurrentIndex(rowId) {
Expand Down

0 comments on commit 38d6267

Please sign in to comment.