]> BookStack Code Mirror - bookstack/blobdiff - resources/js/wysiwyg/ui/framework/toolbars.ts
Lexical: Added a media toolbar, improved toolbars and media selection
[bookstack] / resources / js / wysiwyg / ui / framework / toolbars.ts
index b4e49af950c93342a216b90931b1f7af4aaaa861..de2255444ebf6fcfc43fb7a9a225c3f36c208cc1 100644 (file)
@@ -34,7 +34,11 @@ export class EditorContextToolbar extends EditorContainerUiElement {
 
         dom.hidden = !showing;
 
-        if (!showing) {
+        if (!this.target.isConnected) {
+            // If our target is no longer in the DOM, tell the manager an update is needed.
+            this.getContext().manager.triggerFutureStateRefresh();
+            return;
+        } else if (!showing) {
             return;
         }