fix: unable to clear china region field (#4991)

This commit is contained in:
Katherine 2024-08-06 17:36:46 +08:00 committed by GitHub
parent b13f40c455
commit ecdacf5e20
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -123,9 +123,9 @@ export const Cascader = withDynamicSchemaProps(
onDropdownVisibleChange={handelDropDownVisible}
onChange={(value, selectedOptions: any) => {
if (value && labelInValue) {
onChange(selectedOptions.map((option) => omit(option, [fieldNames.children])));
onChange(selectedOptions.map((option) => omit(option, [fieldNames.children])) || null);
} else {
onChange(value);
onChange(value || null);
}
}}
/>