fix(select-component): invalid mode

This commit is contained in:
chenos 2023-03-16 14:42:41 +08:00
parent 46c736d7d3
commit cd2340ecd0

View File

@ -70,7 +70,10 @@ const filterOption = (input, option) => (option?.label ?? '').toLowerCase().incl
const InternalSelect = connect(
(props: Props) => {
const { objectValue, value, ...others } = props;
const mode = props.mode || props.multiple ? 'multiple' : undefined;
let mode: any = props.multiple ? 'multiple' : props.mode;
if (mode === 'links') {
mode = undefined;
}
const toValue = (v) => {
if (['multiple', 'tags'].includes(mode)) {
return v || [];