microsoft / microsoft/monaco-editor
[Bug] : Editor allows ctrl+v to paste but disables when using context menu paste option.
Open
@mjbvz is already working on this.
Since Jul 10, 2023.
bug
- 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() {
alert('Hello world!');
alert('Hello world!');
}`;
// Hover on each property to see its docs!
const myEditor = monaco.editor.create(document.getElementById("container"), {
value,
language: "javascript",
automaticLayout: true,
pasteAs: {
enabled: false,
},
});
Reproduction Steps
Just visited this doc link: https://microsoft.github.io/monaco-editor/docs.html#interfaces/editor.IEditorOptions.html#pasteAs
and added in the code but it is not working correctly. I want to disable paste option using ctrl+v
Actual (Problematic) Behavior
Context menu paste option is disabled after using
pasteAs: {
enabled: false,
},
but ctrl+v is pasting content as usual
Expected Behavior
It should disable all types of pasting e.g. ctrl+v, context menu paste option, etc...
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.