The tinymce event system would not pick up the focus within the loaded
draw.io instance, after the drawing toolbar button was clicked, hence
the toolbar would hang around.
This adds a hack to dispatch a mousedown event on the body to get the
toolbar to hide.
For #3597
showPopup(editor, textContent, '', (newCode, newLang) => {
const pre = doc.createElement('pre');
const code = doc.createElement('code');
showPopup(editor, textContent, '', (newCode, newLang) => {
const pre = doc.createElement('pre');
const code = doc.createElement('code');
code.classList.add(`language-${newLang}`);
code.innerText = newCode;
pre.append(code);
code.classList.add(`language-${newLang}`);
code.innerText = newCode;
pre.append(code);
icon: 'diagram',
onAction() {
editor.execCommand('drawio');
icon: 'diagram',
onAction() {
editor.execCommand('drawio');
+ // Hack to de-focus the tinymce editor toolbar
+ window.document.body.dispatchEvent(new Event('mousedown', {bubbles: true}));
},
fetch(callback) {
callback([
},
fetch(callback) {
callback([