Parent field twice in UI with nested docs field override

default discord avatar
mvdve
6 months ago
2

Hi All, I am using the nested docs plugin to create a nested category collection. I would like to override the filterOptions value to prevent the selection of a parent who also has a parent (to limit the depth to two deep), but the parent select list component is not merged but rendered twice within the UI. Once the original and also the new one. Same happens for the breadcrumbs. Is this a bug or am i doing something wrong? Thanks.



fields: [
    name(true),
    slug,
    createParentField(
        "locationCategories",
        {
            filterOptions: ({id}) => {
                return {
                    and: [
                        {
                            id: {
                                not_equals: id
                            }
                        },
                        {
                            parent: {
                                exists: false,
                            }
                        },
                    ]
                }
            }
        }
    ),
]
  • discord user avatar
    jesschow
    Payload Team
    2 months ago

    Hi @mvdve are you still experiencing this problem? Quite a few issues were closed out on the nested docs plugin recently.

  • default discord avatar
    mvdve
    2 months ago

    @jesschow Sorry for te late reply, i will test this this week. Thanks for the heads up!



    This has been resolved in 1.0.6. Thanks!

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.