microsoft / microsoft/monaco-editor
[Bug] Cut Event from context menu has event type 'copy'
Open
@hediet is already working on this.
Since Jul 1, 2026.
- 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?
- Not reproducible in the monaco editor playground
Monaco Editor Playground Link
Monaco Editor Playground Code
const value = /* set from `myEditor.getModel()`: */ `function hello() {
console.log("Hello")
}`;
// Hover on each property to see its docs!
const myEditor = monaco.editor.create(document.getElementById("container"), {
value,
language: "javascript",
automaticLayout: true,
});
myEditor.getDomNode().addEventListener('copy', (event) => {
console.log(event.type)
}, true)
myEditor.getDomNode().addEventListener('cut', (event) => {
console.log(event.type)
}, true)
Reproduction Steps
- Select some part of the code.
- Open context menu with right mouse click
- Select 'Cut'
Actual (Problematic) Behavior
The cut event which can be listened to using
myEditor.getDomNode().addEventListener('cut', (event) => {
console.log(event.type)
}, true)
has type 'copy'
Expected Behavior
The event type should be 'copy'
Additional Context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.