fix: allowClear property is set to false when select is required

optimizes the logic for allowClear property values, setting it to false when select is required

Change-Id: I773831872b490ef49536039f2cef773939c0a361
This commit is contained in:
2022-08-24 11:34:58 +08:00
parent 329f810c4d
commit 7772d343d3

View File

@ -157,6 +157,7 @@ export default class FormItem extends React.Component {
checkOptions, checkOptions,
checkBoxInfo, checkBoxInfo,
allowClear, allowClear,
required,
...rest ...rest
} = this.props; } = this.props;
return { return {
@ -171,7 +172,7 @@ export default class FormItem extends React.Component {
optionFilterProp, optionFilterProp,
checkOptions, checkOptions,
checkBoxInfo, checkBoxInfo,
allowClear, allowClear: required ? allowClear || false : allowClear,
...rest, ...rest,
}; };
} }