1
0
Fork 0
mirror of synced 2024-10-03 10:36:59 +13:00

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 96e2ada5bd
commit a90cfc3e73

View file

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