Skip to content

Opening relationship field with appearance: "drawer" inside rich text inline block #13778

@ruslan-amboss

Description

@ruslan-amboss

Describe the Bug

The issue with the relationship field using appearance: "drawer" inside a rich text inline block has resurfaced.

For context:
The original issue was fixed by temporarily introducing a timeout in #12529.
Later, the timeout was increased in #13031 to 100ms, which worked for a while.
We’re now seeing the same issue again, both reproducible in our codebase and in the Payload codebase.
I’ve attached a video demonstrating the problem, and here is the reproduction code.

Link to the code that reproduces this issue

https://github.com/LimChorngUan/payload/blob/reproduce-drawer-collapse/test/_community/collections/Posts/index.ts

Reproduction Steps

issue_is_back.mov
import type { CollectionConfig } from 'payload'

import { BlocksFeature, lexicalEditor } from '@payloadcms/richtext-lexical'

export const postsSlug = 'posts'

export const PostsCollection: CollectionConfig = {
  slug: postsSlug,
  admin: {
    useAsTitle: 'title',
  },
  fields: [
    {
      name: 'title',
      type: 'text',
    },
    {
      name: 'content',
      type: 'richText',
      editor: lexicalEditor({
        features: ({ defaultFeatures }) => [
          ...defaultFeatures,
          BlocksFeature({
            inlineBlocks: [
              {
                slug: 'inline-media',
                fields: [
                  {
                    name: 'media',
                    type: 'relationship',
                    relationTo: ['media'],
                    admin: {
                      appearance: 'drawer',
                    },
                  },
                ],
              },
            ],
          }),
        ],
      }),
    },
    {
      name: 'media',
      type: 'relationship',
      relationTo: ['media'],
      admin: {
        appearance: 'drawer',
      },
    },
  ],
}

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

area: ui

Environment Info

Payload version `3.55.1`

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions