fix: select toValue (#1962)
* fix: select toValue * fix: select toValue
This commit is contained in:
parent
98be397574
commit
ea04d2309e
@ -79,6 +79,12 @@ const InternalSelect = connect(
|
||||
if (objectValue) {
|
||||
return <ObjectSelect {...others} value={value} mode={mode} loading={loading} />;
|
||||
}
|
||||
const toValue = (v) => {
|
||||
if (['tags', 'multiple'].includes(props.mode) || props.multiple) {
|
||||
return toArr(v);
|
||||
}
|
||||
return v;
|
||||
};
|
||||
return (
|
||||
<AntdSelect
|
||||
showSearch
|
||||
@ -86,7 +92,7 @@ const InternalSelect = connect(
|
||||
allowClear
|
||||
dropdownMatchSelectWidth={false}
|
||||
notFoundContent={loading ? <Spin /> : <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />}
|
||||
value={value?value:undefined}
|
||||
value={toValue(value)}
|
||||
{...others}
|
||||
onChange={(changed) => {
|
||||
props.onChange?.(changed === undefined ? null : changed);
|
||||
|
Loading…
Reference in New Issue
Block a user