fix null sub in select
This commit is contained in:
parent
40aa64546a
commit
6a600c2043
|
@ -855,11 +855,11 @@ export function Select ({ label, items, groupClassName, onChange, noForm, overri
|
|||
if (item && typeof item === 'object') {
|
||||
return (
|
||||
<optgroup key={item.label} label={item.label}>
|
||||
{item.items.map(item => <option key={item} value={item.toLowerCase()}>{item}</option>)}
|
||||
{item.items.map(item => <option key={item} value={item?.toLowerCase()}>{item}</option>)}
|
||||
</optgroup>
|
||||
)
|
||||
} else {
|
||||
return <option key={item} value={item.toLowerCase()}>{item}</option>
|
||||
return <option key={item} value={item?.toLowerCase()}>{item}</option>
|
||||
}
|
||||
})}
|
||||
</BootstrapForm.Select>
|
||||
|
|
|
@ -64,10 +64,10 @@ export default function SubSelect ({ prependSubs, sub, onChange, appendSubs, fil
|
|||
const subs = useSubs({ prependSubs, sub, filterSubs, appendSubs })
|
||||
const valueProps = props.noForm
|
||||
? {
|
||||
value: sub.toLowerCase()
|
||||
value: sub?.toLowerCase()
|
||||
}
|
||||
: {
|
||||
overrideValue: sub.toLowerCase()
|
||||
overrideValue: sub?.toLowerCase()
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
Loading…
Reference in New Issue