Calling document.activeElement.blur() can not blur the currently focused editor, can reproduce directly on monaco website.
For example, in Monaco webview Hello World example,
window.e = monaco.editor.create(document.getElementById("container"), {
value: "function hello() {\n\talert('Hello world!');\n}",
language: "javascript"
});
then open devtools and type in the console:
after seeing the cursor blinking
document.activeElement.blur()
then the editor is not blurred and the cursor is still blinking. calling e.isFocused() will return true as well.
Monaco v0.9.0
Calling document.activeElement.blur() can not blur the currently focused editor, can reproduce directly on monaco website.
For example, in Monaco webview Hello World example,
then open devtools and type in the console:
after seeing the cursor blinking
then the editor is not blurred and the cursor is still blinking. calling
e.isFocused()will return true as well.Monaco v0.9.0