Skip to content

Bug: Undo returns the mark of the deleted comment #9166

Description

@levensta

Lexical version: 0.50.0

Steps To Reproduce

  1. Add a comment to the text
  2. Delete the comment thread in the right-hand panel
  3. Press Ctrl + Z

The current behavior

A state is returned containing an invalid marker that references a comment that no longer exists

Screen.Recording.2026-09-13.at.14.49.21.mov

The expected behavior

During Undo/Redo operations, it is necessary to either restore the deleted comment in the right-hand panel or validate the mark ID and remove it if it references a non-existent comment

Impact of fix

The current issue creates redundant mark nodes in the state that do not reference anything. Any users basing their implementation on the CommentPlugin from the playground inherit this bug

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions