Skip to content

Bug: incorrect "redo" behavior with nested editor #4401

Open
@montlebalm

Description

@montlebalm

I noticed a bug while trying to share a history stack across a parent and nested editor. I manually created a history stack and passed it the HistoryPlugin for both editors.

Unfortunately, the "redo" behavior isn't working as expected. When making edits in both editors, only the child's content is restored. There's a point in the "redo" stack where the parent's content should be restored, but only the selection changes.

Lexical version: 0.10.0

Steps To Reproduce

  1. Edit text in parent editor
  2. Edit text in image caption
  3. Undo caption edit
  4. Undo parent edit
  5. Redo parent edit (fails! Jumps to caption editor, but does not reinstate text)
  6. Redo caption edit
Screen_Recording_2023-04-17_at_3.48.54_PM.mov

Link to code example: https://playground.lexical.dev/

The current behavior

The parent editor's selection is restored, but not its content.

The expected behavior

The parent editor's selection and content are restored.

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