diff --git a/src/components/Select.vue b/src/components/Select.vue index c2a994f..7d1abcd 100644 --- a/src/components/Select.vue +++ b/src/components/Select.vue @@ -576,15 +576,16 @@ }, /** - * Callback to determine if the provided option - * should match the current search text. + * Callback to determine if the provided option should + * match the current search text. Used to determine + * if the option should be displayed. * @type {Function} * @param {Object || String} option * @param {String} label * @param {String} search * @return {Boolean} */ - filterComparator: { + filterMatch: { type: Function, default(option, label, search) { return (label || '').toLowerCase().indexOf(search.toLowerCase()) > -1 @@ -608,7 +609,7 @@ if (typeof label === 'number') { label = label.toString() } - return this.filterComparator(option, label, search) + return this.filterMatch(option, label, search) }); } }, diff --git a/test/unit/specs/Select.spec.js b/test/unit/specs/Select.spec.js index 10d6c95..a4d2433 100644 --- a/test/unit/specs/Select.spec.js +++ b/test/unit/specs/Select.spec.js @@ -324,7 +324,7 @@ describe('Select.vue', () => { it('can determine if a given option should match the current search text', () => { const vm = new Vue({ - template: `
`, + template: `
`, data: {value: 'foo'}, methods:{ customFn: (option, label, search) => label.match(new RegExp('^' + search, 'i'))