2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-06-04 06:32:23 +03:00

fallback truthiness check on option label

In case getOptionLabel somehow returns undefined. Overkill, but inexpensive overkill.
This commit is contained in:
Unknown
2017-10-26 12:18:30 -04:00
parent 014c51d1e7
commit 57c084dd8b
+6 -6
View File
@@ -483,19 +483,19 @@
return option;
}
},
/**
* Callback to filter the search result the label text.
* @type {Function}
* @param {Object || String} option
* @param {String} label
* Callback to filter the search result the label text.
* @type {Function}
* @param {Object || String} option
* @param {String} label
* @param {String} search
* @return {Boolean}
*/
filterFunction: {
type: Function,
default(option, label, search) {
return label.toLowerCase().indexOf(search.toLowerCase()) > -1
return (label || '').toLowerCase().indexOf(search.toLowerCase()) > -1
}
},