Skip to content

Commit ea251db

Browse files
authored
Update mixin-filtering.js
1 parent 95eb208 commit ea251db

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/components/table/helpers/mixin-filtering.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,12 @@ export default {
9999
const filterFn = this.computedFilterFn
100100

101101
// We only do local filtering when requested and there are records to filter.
102-
// If not local filtering or no items, we return the original local items array
103-
return filterFn && items.length > 0 ? items.slice().filter(filterFn) : items
102+
// If not local filtering, we return the original local items array
103+
// NOTE:
104+
// For some reason, Vue is not chaching this result when neither items or filterFn
105+
// changes. It is always returning a new array reference (when filtered), which
106+
// is causing filtered events to be emitted when pagination occurs
107+
return filterFn ? items.filter(filterFn) : items
104108
}
105109
},
106110
watch: {
@@ -127,8 +131,8 @@ export default {
127131
// will be a deep clone if the filter is an object.
128132
if (!looseEqual(newCriteria, this.localFilter)) {
129133
const timeout = this.computedFilterDebounce
130-
clearTimeout(this.$_filterTimer)
131-
this.$_filterTimer = null
134+
// clearTimeout(this.$_filterTimer)
135+
// this.$_filterTimer = null
132136
if (timeout && timeout > 0) {
133137
// If we have a debounce time, delay the update of `localFilter`
134138
this.$_filterTimer = setTimeout(() => {

0 commit comments

Comments
 (0)