clarify label when empty string

This commit is contained in:
Clement Zhang
2024-11-06 17:49:48 +01:00
parent d256f41793
commit e94c1f9a9d

View File

@@ -125,12 +125,15 @@
function parseStringItems(resolvedConfigItems: string[]) {
return resolvedConfigItems?.map((item) => {
if (!item || typeof item !== 'string') {
if (item === null || item === undefined || typeof item !== 'string') {
console.error(
'When not labeled, MultiSelect component items should be an array of strings.'
)
return 'not string'
}
if (item === '') {
return 'empty string'
}
return item
})
}