Skip to content

Commit de7814a

Browse files
ruslan-ambosskendelljoseph
authored andcommitted
feat(ui): update RelationshipFilter if only filterOptions are changed (#11985)
### What? Extends trigger of a reload of the fields for RelationshipFilter to include `filterOptions`. ### Why? If you have two or more relationship fields that have a relation to the same collection, the options of the filter will not update. ### How By extending dependencies of `useEffect` ### Code setup: ``` { name: 'media', type: 'relationship', relationTo: 'media', filterOptions: () => { return { id: { in: ['67efaee24648d01dffceecf9'] }, } } }, { name: 'media2', type: 'relationship', relationTo: 'media', filterOptions: () => { return { id: { in: ['67efafb04648d01dffceed75'] }, } } }, ``` ### Before: https://github.com/user-attachments/assets/bdc5135b-3afa-48df-98fe-6a9153dd7710 ### After: https://github.com/user-attachments/assets/d71a7558-6413-4c97-9b0b-678cf3b011d0 -->
1 parent 50cc904 commit de7814a

File tree

1 file changed

+1
-1
lines changed
  • packages/ui/src/elements/WhereBuilder/Condition/Relationship

1 file changed

+1
-1
lines changed

packages/ui/src/elements/WhereBuilder/Condition/Relationship/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ export const RelationshipFilter: React.FC<Props> = (props) => {
324324
}
325325
})
326326
}
327-
}, [i18n, relationTo, debouncedSearch])
327+
}, [i18n, relationTo, debouncedSearch, filterOptions])
328328

329329
/**
330330
* Load any other options that might exist in the value that were not loaded already

0 commit comments

Comments
 (0)