microsoft / microsoft/monaco-editor

[Bug] Typing is blocked after right click in the editor when set `contextmenu` to false

Open
#4,560 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
46.8k
Forks
4.1k
Avg merge
17h 58m
Merged PRs (30d)
1

Description

Reproducible in vscode.dev or in VS Code Desktop?
  • Not reproducible in vscode.dev or VS Code Desktop
Reproducible in the monaco editor playground?
Monaco Editor Playground Link

https://microsoft.github.io/monaco-editor/playground.html?source=v0.49.0#XQAAAALJAQAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscwz_GxhBJ5fIHXMASoNoP2xswbooi08h0RuE1UDbfMloSJTJ96e9a92yGy9rsUOSS3CorNJNbYJPe7HqptEMy32ZThw_sFlmuw51bxKsb_rKqPkAUEX-VNt4yrf3cAmTwJa9MACRwSwwtF2PbQ2AAswmnyIUm4AWpzYxlZ_B60BBbceC-OLqAuoUowSNNqtfjOxQOub1kamYtXXY5Z2HDq_yqsifTjJzNKAO_tNcApVQsp51yWxO7WFNjA3lbqwnHjKbDW4BqPxQwxIoi3TWuVDSVLwpyRyOlHkxH7zUBrhvZ5vWUJxxtik9RVySb-AsvQi6aCxlh29IC9ggsxO-zoVwK-e1cVIBEBprcW0SJOUy1ys106GyinQjGccRFSZSwx_-gn-gg

Monaco Editor Playground Code
const value = /* set from `myEditor.getModel()`: */ `function hello() {
	alert('Hello world!');
}
{{{}}}jjjjjjjj`;

// Hover on each property to see its docs!
const myEditor = monaco.editor.create(document.getElementById("container"), {
	value,
	language: "javascript",
	automaticLayout: true,
	bracketPairColorization: {enabled: false}
});

myEditor.updateOptions({
	contextmenu: false
})
Reproduction Steps
  1. Simply set contextmenu to false
  2. Right click in the editor
  3. Then try typing in the editor. The cursor is blinking, however, typing is blocked
Actual (Problematic) Behavior

The typing is blocked after right click in the editor

Expected Behavior

The typing should not be blocked

Additional Context

No response

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 linked Monaco Editor Playground reproduction and the provided TypeScript setup, then inspect the behavior when contextmenu is set to false. Confirm that right-clicking leaves the editor unable to accept typing, and consider the issue complete when typing works normally afterward.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.