diff --git a/packages/ui/src/elements/WhereBuilder/Condition/index.tsx b/packages/ui/src/elements/WhereBuilder/Condition/index.tsx index 6e9e9e45211..d1c65b5377b 100644 --- a/packages/ui/src/elements/WhereBuilder/Condition/index.tsx +++ b/packages/ui/src/elements/WhereBuilder/Condition/index.tsx @@ -194,7 +194,7 @@ export const Condition: React.FC = (props) => { onClick={() => addCondition({ andIndex: andIndex + 1, - fieldName: fields[0].value, + fieldName: fields.find((field) => !field.field.admin?.disableListFilter).value, orIndex, relation: 'and', }) diff --git a/packages/ui/src/elements/WhereBuilder/index.tsx b/packages/ui/src/elements/WhereBuilder/index.tsx index f55ddb93054..bd48146d730 100644 --- a/packages/ui/src/elements/WhereBuilder/index.tsx +++ b/packages/ui/src/elements/WhereBuilder/index.tsx @@ -233,7 +233,8 @@ export const WhereBuilder: React.FC = (props) => { if (reducedFields.length > 0) { addCondition({ andIndex: 0, - fieldName: reducedFields[0].value, + fieldName: reducedFields.find((field) => !field.field.admin?.disableListFilter) + .value, orIndex: conditions.length, relation: 'or', })