Skip to content

Monaco's underlying textarea, and content, can get out of sync when native undo is used #1782

@issacgerges

Description

@issacgerges

monaco-editor version: 0.19.3
Browser: Chrome and Chromium
OS: MacOS

When using Chrome's system menus to undo/redo the textarea that backs monaco can become out of sync with the editor content.

Repro

When unfocusing and recfocusing Chrome via cmd+~, the editor fails to respond to undo and redo events. I've added the following css to unhide the underlying textarea

textarea.inputarea {
    width: 100px !important;
    color: white !important;
    background: rgb(150, 114, 236) !important;
};

textarea-sync

Suggestions

I'm unfamiliar with monaco but believe this issue could be fixed by also explicitly attaching a change handler to the textarea (which I've verified does fire in this case)

Metadata

Metadata

Labels

bugIssue identified by VS Code Team member as probable bugeditor-input

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions