ToggleToolbarDrawer persist visible even when I close or switch tab and closing of bootstrap modal

14 Views Asked by At

I use bootstrap 4.3 for opening of modal where tinymce is loaded.

Tinymce is loaded in a limited space in a modal. Click on the toggle toolbar drawer to reveal remaining toolbar button item while toggle toolbar drawer is open. I close the modal and toggle toolbar drawer is still visible, same goes when tinymce is in a tab content, switching to another tab while toggle toolbar drawer is open will still be visible after switching tab contents.

I tried the code below but no success.

if ( tinymce.activeEditor.queryCommandState('ToggleToolbarDrawer') ) {
  tinymce.activeEditor.execCommand('ToggleToolbarDrawer');
}

For bootstrap modal:

$(document).on("focusin", function(e) {
    if ($(e.target).closest(".tox-dialog").length) {
        e.stopImmediatePropagation();
    }
});

Chrome: 122.0.6261.128

Windows: 10

Tinymce: 6.7.0

jQuery: 3.4.1

Bootstrap: 4.3

I was expecting that the toggle toolbar drawer should not be visible when switching or closing of tab but somehow it is floating on the page even if the actual tinymce textarea is already gone.

0

There are 0 best solutions below