Skip to content

Commit ed8bd01

Browse files
authored
Update mixin-filtering.js
1 parent 7985223 commit ed8bd01

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

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

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -121,17 +121,21 @@ export default {
121121
// an object when using `filter-function`
122122
deep: true,
123123
handler(newCriteria, oldCriteria) {
124-
const timeout = this.computedFilterDebounce
125-
clearTimeout(this.$_filterTimer)
126-
this.$_filterTimer = null
127-
if (timeout && timeout > 0) {
128-
// If we have a debounce time, delay the update of `localFilter`
129-
this.$_filterTimer = setTimeout(() => {
130-
this.localFilter = this.filterSanitize(newCriteria)
131-
}, timeout)
132-
} else {
133-
// Otherwise, immediately update `localFilter` with `newFilter` value
134-
this.localFilter = this.filterSanitize(newCriteria)
124+
newCriteria = this.filterSanitize(newCriteria)
125+
oldCriteria = this.filterSanitize(oldCriteria)
126+
if (!looseEqual(newCriteria, oldCriteria)) {
127+
const timeout = this.computedFilterDebounce
128+
clearTimeout(this.$_filterTimer)
129+
this.$_filterTimer = null
130+
if (timeout && timeout > 0) {
131+
// If we have a debounce time, delay the update of `localFilter`
132+
this.$_filterTimer = setTimeout(() => {
133+
this.localFilter = newCriteria
134+
}, timeout)
135+
} else {
136+
// Otherwise, immediately update `localFilter` with `newFilter` value
137+
this.localFilter = newCriteria
138+
}
135139
}
136140
}
137141
},

0 commit comments

Comments
 (0)