diff --git a/_extensions/webr/qwebr-monaco-editor-element.js b/_extensions/webr/qwebr-monaco-editor-element.js index 980a73c4..5644e67e 100644 --- a/_extensions/webr/qwebr-monaco-editor-element.js +++ b/_extensions/webr/qwebr-monaco-editor-element.js @@ -146,13 +146,10 @@ globalThis.qwebrCreateMonacoEditorInstance = function (cellData) { // Add a click event listener to the reset button copyButton.onclick = function () { - // Ensure the editor is in focus - editor.focus(); - - // Retrieve data + // Retrieve current code data const data = editor.getValue(); - // Set the clipboard contents. + // Write code data onto the clipboard. navigator.clipboard.writeText(data || ""); };