mirror of
https://github.com/tenrok/vue-select.git
synced 2026-06-22 10:30:34 +03:00
fallback truthiness check on option label
In case getOptionLabel somehow returns undefined. Overkill, but inexpensive overkill.
This commit is contained in:
@@ -483,19 +483,19 @@
|
|||||||
return option;
|
return option;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback to filter the search result the label text.
|
* Callback to filter the search result the label text.
|
||||||
* @type {Function}
|
* @type {Function}
|
||||||
* @param {Object || String} option
|
* @param {Object || String} option
|
||||||
* @param {String} label
|
* @param {String} label
|
||||||
* @param {String} search
|
* @param {String} search
|
||||||
* @return {Boolean}
|
* @return {Boolean}
|
||||||
*/
|
*/
|
||||||
filterFunction: {
|
filterFunction: {
|
||||||
type: Function,
|
type: Function,
|
||||||
default(option, label, search) {
|
default(option, label, search) {
|
||||||
return label.toLowerCase().indexOf(search.toLowerCase()) > -1
|
return (label || '').toLowerCase().indexOf(search.toLowerCase()) > -1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user