Skip to content

[examples/editable-voids] Cmd+Z only clears input text instead of removing newly inserted editable void #8

@wudidewo12

Description

@wudidewo12

Description

In examples/editable-voids, undo behaves differently after adding a new editable void and typing into the native Name input inside that newly inserted block.

The live reference removes the newly inserted editable void block when Cmd+Z is pressed. The local v2 build only clears the input value and leaves the newly inserted editable void block in the document.

This looks like an undo/history boundary issue between inserting the editable void Slate node and editing the native input rendered inside it.

Recording

Screenshots attached below:

Live reference expected behavior:

Image

Local actual behavior:

Image

Video attached below:

issue-007-editable-voids-input-undo-history.mp4

Sandbox

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

Local reproduction URL:

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

Live reference URL:

https://www.slatejs.org/examples/editable-voids

Steps

To reproduce the behavior:

  1. Open examples/editable-voids.
  2. Click the + button to insert a new editable void block.
  3. In the Name input of the newly inserted editable void block, type abc.
  4. Press Cmd+Z.
  5. Compare the result with the live reference site.

Expectation

The local behavior should match the live reference behavior.

Live reference expected behavior:

  • After pressing Cmd+Z, the newly inserted editable void block is removed.
  • The undo step appears to undo the insertion of the editable void block.

Actual behavior

Local actual behavior:

  • After pressing Cmd+Z, only the abc text inside the native Name input is cleared.
  • The newly inserted editable void block remains in the document.

Environment

  • Slate Version: v2 branch, commit ce2bd6c6
  • Operating System: macOS
  • Browser: Chrome
  • Local examples site: http://localhost:3100
  • Live reference site: https://www.slatejs.org
  • TypeScript Version: No response

Context

This was manually reproduced on the current local v2 build after the latest pull. The behavior appears specific to undo/history coordination between an inserted editable void Slate node and a native input rendered inside that void.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    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