microsoft / microsoft/monaco-editor

Native browser undo/redo commands take incorrect effect to the editor content

Open
#2,346 0 comments 11 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug editor-input help wanted
Dominant language
JavaScript
Stars
46.8k
Forks
4.1k
Avg merge
17h 58m
Merged PRs (30d)
1

Description

monaco-editor version: 0.22.3
Browser: Firefox 85
OS: Windows 10
Playground code that reproduces the issue:

function x() {
	console.log("Hello world!");
}

I've reproduced it by the following steps:

  1. Start Monaco playground.
  2. Type some text.
  3. Click the Undo item in the browser menu bar.
  4. Nothing happens.
  5. Click the Redo item in the browser menu bar.
  6. The entered text will be duplicated.
  7. Also, doesn't work with document.execCommand('undo') in Chrome.

monaco-editor-undo-redo

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Monaco playground and reproduce the behavior using the provided JavaScript snippet, then compare the browser Undo and Redo menu commands with document.execCommand('undo'). Done means browser Undo changes the editor content correctly and Redo does not duplicate typed text, including the reported Chrome case.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.