์ผ€์ด์Šค ce-0037 ยท ์‹œ๋‚˜๋ฆฌ์˜ค scenario-undo-redo-behavior

Undo stack is cleared when programmatically modifying content

OS: macOS Ubuntu 22.04 ๊ธฐ๊ธฐ: Desktop or Laptop Any ๋ธŒ๋ผ์šฐ์ €: Safari 120.0 ํ‚ค๋ณด๋“œ: US ์ดˆ์•ˆ
undoprogrammaticsafari

์ด ํŽ˜์ด์ง€๋Š” ์•„์ง ๋ฒˆ์—ญ๋˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค

ํ˜„์žฌ ์˜์–ด ์›๋ฌธ์„ ํ‘œ์‹œํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ๋ฒˆ์—ญ์— ๊ธฐ์—ฌํ•ด ์ฃผ์‹œ๋ฉด ๊ฐ์‚ฌํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

Phenomenon

When programmatically modifying the content of a contenteditable region (e.g., using innerHTML or textContent), the undo stack is cleared in Safari. This prevents users from undoing their previous manual edits.

Reproduction example

  1. Create a contenteditable div.
  2. Type some text manually.
  3. Use JavaScript to modify the content: element.innerHTML = 'New content'.
  4. Try to undo (Cmd+Z).
  5. Observe whether the previous manual edits can be undone.

Observed behavior

  • In Safari on macOS, programmatic content changes clear the undo stack.
  • Users cannot undo their previous manual edits after programmatic changes.
  • The undo history is lost unexpectedly.

Expected behavior

  • Programmatic changes should not clear the undo stack for manual edits.
  • Or, there should be a way to preserve undo history across programmatic modifications.
  • The undo stack should be managed more intelligently.

์ด ์‹œ๋‚˜๋ฆฌ์˜ค์˜ ๋ณ€ํ˜•

์ผ€์ด์Šค OS ๋ธŒ๋ผ์šฐ์ € ์ƒํƒœ
ce-0016 Windows 11 Edge 120.0 ์ดˆ์•ˆ
ce-0037 macOS Ubuntu 22.04 Safari 120.0 ์ดˆ์•ˆ

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: macOS Ubuntu 22.04
Device: Desktop or Laptop Any
Browser: Safari 120.0
Keyboard: US
Your environment

Use this editable area to reproduce the described case.

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.