Skip to content

fix(richtext-lexical, ui): opening relationship field with appearance: "drawer" inside rich text inline block #12529

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2025

Conversation

GermanJablo
Copy link
Contributor

@GermanJablo GermanJablo commented May 23, 2025

To reproduce this bug, insert the following feature into the richtext editor:

BlocksFeature({
  inlineBlocks: [
    {
      slug: 'inline-media',
      fields: [
        {
          name: 'media',
          type: 'relationship',
          relationTo: ['media'],
          admin: {
            appearance: 'drawer',
          },
        },
      ],
    },
  ],
}),

Then try opening the relationship field drawer. The inline block drawer will close.

Note: Interestingly, at least in Chrome, this only happens with DevTools closed. It worked fine with DevTools open. It probably has to do with capturing events like focus.
The current solution is a 50ms delay. I couldn't test it with CPU throttle because it disappears when I close the devtools. If you encounter this bug, please open an issue so we can increase the delay or, better yet, find a more elegant solution.

@GermanJablo GermanJablo merged commit f2b54b5 into main May 28, 2025
84 checks passed
@GermanJablo GermanJablo deleted the inline-drawer branch May 28, 2025 14:31
Copy link
Contributor

🚀 This is included in version v3.40.0

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

Successfully merging this pull request may close these issues.

2 participants