Coerce picker option labels to string to fix bug when using autocomplete with numeric labels

This commit is contained in:
Andrew Kingston 2021-12-08 09:45:50 +00:00
parent 58f1d44e18
commit 6b316f8a8f
1 changed files with 3 additions and 3 deletions

View File

@ -63,9 +63,9 @@
const getFilteredOptions = (options, term, getLabel) => { const getFilteredOptions = (options, term, getLabel) => {
if (autocomplete && term) { if (autocomplete && term) {
const lowerCaseTerm = term.toLowerCase() const lowerCaseTerm = term.toLowerCase()
return options.filter(option => return options.filter(option => {
getLabel(option)?.toLowerCase().includes(lowerCaseTerm) return `${getLabel(option)}`?.toLowerCase().includes(lowerCaseTerm)
) })
} }
return options return options
} }