fix: error opening when data scope is null (#2178)

* fix: error opening when data scope is null

* fix: error opening when data scope is null
This commit is contained in:
katherinehhh 2023-07-04 17:17:51 +08:00 committed by GitHub
parent 650a580aca
commit 46294692dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,7 +10,7 @@ export const FilterItems = observer(
const field = useField<ArrayFieldModel>(); const field = useField<ArrayFieldModel>();
return ( return (
<div> <div>
{field?.value?.map((item, index) => { {field?.value?.filter(Boolean).map((item, index) => {
return ( return (
<RemoveConditionContext.Provider key={index} value={() => field.remove(index)}> <RemoveConditionContext.Provider key={index} value={() => field.remove(index)}>
<ObjectField name={index} component={[item.$and || item.$or ? FilterGroup : FilterItem]} /> <ObjectField name={index} component={[item.$and || item.$or ? FilterGroup : FilterItem]} />