Repository navigation
After monaco multi-instance destroys one instance, another instance cannot get the content[Bug] #3686
Unanswered
blue (MichaelHao25)
asked this question in
Q&A
Replies: 5 comments 1 reply
|
pls help me。。 |
0 replies
|
I think you misunderstood the issue. The issue is that commands are not linked to an editor but global even though you add them using an editor instance |
0 replies
Please help me how to solve this problem,tks |
0 replies
|
I suggest you use the const a = monaco.editor.create(document.getElementById('container'), {
value: "function hello() {\n\talert('Hello world!');\n}",
language: 'javascript'
});
a.addAction({
id: 'save',
label: 'Save',
keybindings: [monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyS],
run(editor) {
console.log(editor.getModel().id)
}
})
const b = monaco.editor.create(document.getElementById('container2'), {
value: "function hello() {\n\talert('Hello world!');\n}",
language: 'javascript'
});
b.addAction({
id: 'save',
label: 'Save',
keybindings: [monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyS],
run(editor) {
console.log(editor.getModel().id)
}
})
document.getElementById('dispose').onclick = () => {
b.dispose();
} |
1 reply
|
Can anyone tell how to remove action in reactjs |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Reproducible in vscode.dev or in VS Code Desktop?
Reproducible in the monaco editor playground?
Monaco Editor Playground Code
js
All reactions