You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make preventDefault reserve undo history saving option #1501
This issue is a rewrite of the issue I made to ecma262.
While many systems use contenteditable, managing browser undo/redo history is painful because:
When using preventDefault() to input or paste event, the history can't follow those operations.
Bypassing all browser undo and managing undo history by hand is tedious.
What solutions exist today?
No response
How would you solve it?
We wish is we could use undo history easier?
The best thing is changing current preventDefault() behavior to save undo history anyway, but this would cause bugs. So instead I'd like to add an option parameter:
document.querySelector("#editor").addEventListener("paste",(e)=>{e.preventDefault(true);// preventDefault does not need args as of now, so adding them is not dangerous.}
or like this:
e.preventDefault({undo: true});// Purpose has made clearer.
Activity
annevk commentedon Sep 1, 2026
This sounds a lot like https://dvcs.w3.org/hg/undomanager/raw-file/tip/undomanager.html which I don't think was ever finished. @rniwa do you know what the current state of that is?
smaug---- commentedon Sep 21, 2026
Is this a dup of w3c/editing#509 ?