Back to Plate

Slate Issue 17 Editable Voids Undo Focus

docs/plans/2026-05-24-slate-issue-17-editable-voids-undo-focus.md

53.0.62.2 KB
Original Source

Slate Issue 17 Editable Voids Undo Focus

Goal

Resolve udecode/slate#17: undoing after typing into the native Name input of a newly inserted editable void can crash with Could not set focus, editor seems stuck with pending operations.

Source

  • Issue: https://github.com/udecode/slate/issues/17
  • Route: http://localhost:3100/examples/editable-voids
  • Reported baseline: Slate v2 commit e62c2046, Chrome on macOS
  • Attachment: GitHub user attachment resolves to video/mp4; transcript required before implementation.

Current Plan

  1. Fetch issue source and transcript attached video.
  2. Inspect current .tmp/slate-v2 editable-voids source, tests, DOM focus handling, and native input undo/history path.
  3. Reproduce current behavior on the local example.
  4. If red-current, add the smallest browser proof row, fix the durable owner, and verify from current .tmp/slate-v2.
  5. If already accounted, keep runtime code unchanged, verify current behavior, comment, and close if confidence is high.

Findings

  • Video transcript:
    • [00:00] editable-voids example is open.
    • [00:01]-[00:05] user focuses the Name input and types abc.
    • [00:06] user performs undo.
    • [00:07]-[00:10] page shows runtime error: Could not set focus, editor seems stuck with pending operations, stack includes Object.focus.
  • Current .tmp/slate-v2 does not reproduce the crash. The existing undo from a new editable void input removes the inserted void block row passes.
  • Tightened that row to record the exact pending-focus runtime error patterns and assert none after undo settles.
  • Current classification: already-accounted with strengthened browser proof.

Verification Log

  • PLAYWRIGHT_BASE_URL=http://localhost:3100 PLAYWRIGHT_RETRIES=0 PLAYWRIGHT_WORKERS=1 bun playwright playwright/integration/examples/editable-voids.test.ts --project=chromium --grep "undo from a new editable void input removes the inserted void block": passed.
  • PLAYWRIGHT_BASE_URL=http://localhost:3100 PLAYWRIGHT_RETRIES=0 PLAYWRIGHT_WORKERS=1 bun playwright playwright/integration/examples/editable-voids.test.ts --project=chromium: 15 passed.
  • bun check: passed.
  • bun lint:fix: passed, no fixes applied.