@@ -122,18 +122,22 @@ export default {
122
122
deep : true ,
123
123
handler ( newCriteria , oldCriteria ) {
124
124
newCriteria = this . filterSanitize ( newCriteria )
125
- oldCriteria = this . filterSanitize ( oldCriteria )
126
- const timeout = this . computedFilterDebounce
127
- clearTimeout ( this . $_filterTimer )
128
- this . $_filterTimer = null
129
- if ( timeout && timeout > 0 ) {
130
- // If we have a debounce time, delay the update of `localFilter`
131
- this . $_filterTimer = setTimeout ( ( ) => {
125
+ // We can't compare newCriteria and oldCriteria, as they
126
+ // could point to the same object reference. But `localFilter`
127
+ // will be a deep clone if the filter is an object.
128
+ if ( newCriteria !== this . localFilter ) {
129
+ const timeout = this . computedFilterDebounce
130
+ clearTimeout ( this . $_filterTimer )
131
+ this . $_filterTimer = null
132
+ if ( timeout && timeout > 0 ) {
133
+ // If we have a debounce time, delay the update of `localFilter`
134
+ this . $_filterTimer = setTimeout ( ( ) => {
135
+ this . localFilter = newCriteria
136
+ } , timeout )
137
+ } else {
138
+ // Otherwise, immediately update `localFilter` with `newFilter` value
132
139
this . localFilter = newCriteria
133
- } , timeout )
134
- } else {
135
- // Otherwise, immediately update `localFilter` with `newFilter` value
136
- this . localFilter = newCriteria
140
+ }
137
141
}
138
142
}
139
143
} ,
0 commit comments