@@ -257,8 +257,14 @@ export default {
257
257
defaultFilterFnFactory ( criteria ) {
258
258
// Generates the default filter function, using the given filter criteria
259
259
// Returns `null` if no criteria or criteria format not supported
260
+
261
+ // Grab some values ahead of time (to trigger reactive changes)
262
+ const filterIgnored = this . computedFilterIgnored
263
+ const filterIncluded = this . computedFilterIncluded
264
+ const fieldsObj = this . computedFieldsObj
265
+
266
+ // Built in filter can only support strings or RegExp criteria (at the moment)
260
267
if ( ! criteria || ! ( isString ( criteria ) || isRegExp ( criteria ) ) ) {
261
- // Built in filter can only support strings or RegExp criteria (at the moment)
262
268
return null
263
269
}
264
270
@@ -274,11 +280,6 @@ export default {
274
280
regExp = new RegExp ( `.*${ pattern } .*` , 'i' )
275
281
}
276
282
277
- // Grab some values ahead of time
278
- const filterIgnored = this . computedFilterIgnored
279
- const filterIncluded = this . computedFilterIncluded
280
- const fieldsObj = this . computedFieldsObj
281
-
282
283
// Generate the wrapped filter test function to use
283
284
const fn = item => {
284
285
// This searches all row values (and sub property values) in the entire (excluding
@@ -295,14 +296,7 @@ export default {
295
296
//
296
297
// We set `lastIndex = 0` on the `RegExp` in case someone specifies the `/g` global flag
297
298
regExp . lastIndex = 0
298
- return regExp . test (
299
- stringifyRecordValues (
300
- item ,
301
- filterIgnored ,
302
- filterIncluded ,
303
- fieldsObj
304
- )
305
- )
299
+ return regExp . test ( stringifyRecordValues ( item , filterIgnored , filterIncluded , fieldsObj ) )
306
300
}
307
301
308
302
// Return the generated function
0 commit comments