Case ce-0113-undo-redo-custom-ops · Scenario scenario-undo-redo-stack

Custom operations are not added to undo stack

OS: Windows 11 Device: Desktop or Laptop Any Browser: Chrome 120.0 Keyboard: US Status: draft
undo redo history chrome

Phenomenon

When using preventDefault() and implementing custom editing operations, those operations are not added to the browser’s undo stack. Users cannot undo custom operations using Ctrl+Z.

Reproduction example

  1. Implement custom text insertion with preventDefault()
  2. Insert some text
  3. Press Ctrl+Z to undo

Observed behavior

  • Custom operation is not undone
  • Browser’s undo stack does not include the operation
  • User cannot undo custom operations
  • Undo/redo functionality is broken for custom features

Expected behavior

  • Custom operations should be undoable
  • Undo stack should include all operations
  • Ctrl+Z should work for custom operations
  • Redo should also work

Browser Comparison

  • All browsers: Custom operations not in undo stack
  • This is expected behavior when using preventDefault()
  • Custom undo/redo implementation needed

Notes and possible direction for workarounds

  • Implement custom undo/redo stack
  • Save state before each operation
  • Restore state on undo
  • Handle Ctrl+Z and Ctrl+Y manually
  • Maintain separate undo/redo stacks

Browser compatibility matrix

This matrix shows which browser and OS combinations have documented cases for this scenario. The current case is highlighted. Click on a cell to view other cases.

Current case
Confirmed
Draft
No case documented

All variants (detailed table)

Complete list of all cases for this scenario with full environment details.

Case OS Device Browser Keyboard Status
ce-0113-undo-redo-custom-ops Windows 11 Desktop or Laptop Any Chrome 120.0 US draft
ce-0129-undo-redo-stack-cleared Windows 11 Desktop or Laptop Any Chrome 120.0 US draft
ce-0141-undo-redo-multiple-ops Windows 11 Desktop or Laptop Any Chrome 120.0 US draft
ce-0150-undo-redo-custom-formatting Windows 11 Desktop or Laptop Any Chrome 120.0 US draft
ce-0173-undo-redo-custom-text-insert Windows 11 Desktop or Laptop Any Chrome 120.0 US draft

Playground for this case

Use the reported environment as a reference and record what happens in your environment while interacting with the editable area.

Reported environment
OS: Windows 11
Device: Desktop or Laptop Any
Browser: Chrome 120.0
Keyboard: US
Your environment
Sample HTML:
Event log
Use this log together with the case description when filing or updating an issue.
0 events
Interact with the editable area to see events here.

Comments & Discussion

Have questions, suggestions, or want to share your experience? Join the discussion below.