Case ce-0173-undo-redo-custom-text-insert · Scenario scenario-undo-redo-stack

Custom text insertion cannot be undone

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

Phenomenon

When using preventDefault() and implementing custom text insertion in Chrome, those operations cannot be undone using Ctrl+Z. The undo stack does not include custom text insertions.

Reproduction example

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

Observed behavior

  • Text insertion is not undone
  • Browser’s undo stack does not include the operation
  • User cannot undo custom text insertions
  • Undo/redo functionality is broken for custom features

Expected behavior

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

Browser Comparison

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

Notes and possible direction for workarounds

  • Implement custom undo/redo stack
  • Save state before each text insertion
  • Restore state on undo
  • Handle Ctrl+Z and Ctrl+Y manually
Before
Hello World
Basic text
After Custom Insert
Hello World New
Custom text inserted via preventDefault()
vs
✅ Expected
Hello World
Expected: Custom text insertion can be cancelled with Undo

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.