Skip to content

Bug: Editor freezes when pasting text copied from websites into a nested editor state #7635

@johnnyoshika

Description

@johnnyoshika

The editor consistently freezes when pasting text copied from websites into a nested editor state.

Lexical version: Observed in v0.30.0 and v0.32.1

Steps To Reproduce

  1. Go to https://playground.lexical.dev/
  2. Delete everything and insert sample image
  3. Add caption
  4. Type something into the caption (e.g. foo bar)
  5. Delete what you typed into the caption
  6. Copy text from somewhere in github.com (e.g. some random text from a GitHub issue)
  7. Paste it into the image caption in Lexical Playground (note: image caption is a nested editor state)
  8. The editor is now frozen

Demo video:

20250620-1549-37.0186866.mp4

The current behavior

Pasting text from websites into the editor causes it to freeze.

The expected behavior

Pasting text from websites doesn't cause the editor to freeze.

Impact of fix

This is a very severe bug. We use nested editor states in several custom Lexical plugins. Our users commonly paste content into them, which causes the editor to freeze and become unusable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions