Skip to content

ctrl-z does not work after pasting text #75

@RobinEd

Description

@RobinEd

the Undo functionality no longer works

Root cause

Press This uses BlockEditorProvider directly rather than the full EditorProvider from @wordpress/editor. BlockEditorKeyboardShortcuts (which is included) only registers block-level shortcuts like duplicate and remove — not undo/redo. In the full Gutenberg editor, EditorKeyboardShortcuts registers Ctrl+Z / Cmd+Z, but Press This never included it.

Before paste, the browser's native contentEditable undo stack handles Ctrl+Z for typing. When the user pastes, Gutenberg intercepts the event and processes clipboard data programmatically (creating/replacing blocks through React and the store), which invalidates the native undo stack. After that, Ctrl+Z has nothing to undo natively, and no keyboard shortcut is wired to the block editor store's undo() action.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions