Skip to content

[examples/editable-voids] Undoing a new editable void can crash with pending focus operations #17

@wudidewo12

Description

@wudidewo12

Description

In examples/editable-voids, undoing after typing into the native Name input of a newly inserted editable void can surface a runtime error from focus handling.

This is separate from the previously tracked Cmd+Z caret-restoration issue. The document visually undoes/removes the newly inserted editable void, but then the page can crash with a pending focus operations error.

Recording

Screenshot attached below:

Runtime error after Cmd+Z:
[drag /Users/dream/Desktop/regression-issues/screenshots/raw/unstable-001-editable-voids-undo-focus-pending-operations.png here]

Video attached below:

CleanShot.2026-05-23.at.00.43.32.mp4

Sandbox

No standalone sandbox. Reproduced in the Slate Editable Voids example.

Local reproduction URL:

http://localhost:3100/examples/editable-voids

Steps

  1. Open examples/editable-voids.
  2. Click + to insert a new editable void block.
  3. In the Name input inside the newly inserted editable void, type abc.
  4. Press Cmd+Z.

Expectation

Undo should remove the newly inserted editable void and the page should remain usable without any runtime error.

Actual behavior

The newly inserted editable void can be removed, but the page shows a runtime error:

Could not set focus, editor seems stuck with pending operations

The stack points to packages/slate-dom/src/plugin/dom-editor.ts in Object.focus.

Environment

  • Slate Version: v2 branch, commit e62c2046
  • Operating System: macOS
  • Browser: Chrome
  • Local examples site: http://localhost:3100

Impact

This breaks a normal undo path in examples/editable-voids. A user can trigger a runtime error by inserting an editable void, typing in its native input, and undoing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions