Skip to content

Relationship filterOptions do not updated after adding item to join field #11661

Open

Description

@AaronClaes

Describe the Bug

I have a collection where you can select a default post based on the posts in a join field in that same collection.

I use the filterOption on the relationship field to only show posts that are in the join field, but this does not update when you add a new item to the join field while editing.

Because this functionality does work with a relationship field instead of a join field, I was asked (on Discord) to provide a working version with a relationship field and the broken version with the join field

Link to the code that reproduces this issue

https://github.com/AaronClaes/payload-join-bug

Reproduction Steps

Step 1:

Create a join field collection without default value or posts
Image

Step 2:

If it's created, use the "Create new Post" button from the join field and save the new post.
Image

Step 3:

Notice how the default post select still has no possible options
Image

Step 4:

Refresh and now the default post option is there
Image

Remark:
You can do step 2 at any given time, it is not related to how many posts are in the join field already, step 3 will never show the newly added post

Which area(s) are affected? (Select all that apply)

area: ui

Environment Info

Binaries:
  Node: 23.5.0
  npm: 10.9.2
  Yarn: 1.22.19
  pnpm: 9.15.1
Relevant Packages:
  payload: 3.28.0
  next: 15.2.0
  @payloadcms/db-mongodb: 3.28.0
  @payloadcms/email-nodemailer: 3.28.0
  @payloadcms/graphql: 3.28.0
  @payloadcms/next/utilities: 3.28.0
  @payloadcms/payload-cloud: 3.28.0
  @payloadcms/richtext-lexical: 3.28.0
  @payloadcms/translations: 3.28.0
  @payloadcms/ui/shared: 3.28.0
  react: 19.0.0
  react-dom: 19.0.0
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:30 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6000
  Available memory (MB): 16384
  Available CPU cores: 8

Activity

  1. added
    status: needs-triage
    validate-reproduction
    on Mar 12, 2025
  2. removed
    validate-reproduction
    on Mar 12, 2025
  3. AaronClaes commented on Apr 8, 2025

    @AaronClaes
    ContributorAuthor

    This issue still happens on the latest version (3.33.0) of payload.
    This is becoming a pretty annoying UX problem.

  4. AaronClaes commented on May 15, 2025

    @AaronClaes
    ContributorAuthor

    Updated the reproduction to payload version 3.37.0, issue still happens

  5. mariovalney commented on Oct 19, 2025

    @mariovalney

    +1

    Join fields don't trigger field changes when added/removed/updated.

    Use case:

    • My collection updates parent status when created.
    • I expect the data to be updated on parent collection or at least have a React Hook to work.

    I've tried useField and useDocumentEvents without success.

    For comparison:
    TextField triggers useField but JoinField don't.

    It would be a nice UX to have the documentForm updated when updating Join table (as we have a way to change data there) or, at least, a good DX to have a way to get these updates to trigger our own.

  6. JessRynkar commented on Jan 20, 2026

    @JessRynkar
    Member

    Hi! Apologies for the long delay in getting a response here, are you still experiencing this on the latest version v3.72.0?

  7. AaronClaes commented on Jan 20, 2026

    @AaronClaes
    ContributorAuthor

    Hi @JessRynkar,
    I bumped the reproduction to v3.72.0. The issue still happens when following the repro steps.

  8. added
    status: verified
    on Jul 14, 2026
  9. removed
    status: needs-triage
    on Jul 14, 2026
  10. mikkelwf commented on Aug 31, 2026

    @mikkelwf
    Contributor

    If it any help, i'm using filterOptions on a join (which doesn't work)..
    It seems if i wrap the query in a function, then it works.. 🤷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugengagement: mediumstalestatus: verified

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions