Browse Source

fix(admin-ui): Fix prosemirror error when changing product detail tabs

Michael Bromley 5 years ago
parent
commit
8a7cf9a9d3

+ 3 - 1
packages/admin-ui/src/lib/core/src/shared/components/rich-text-editor/prosemirror/prosemirror.service.ts

@@ -59,7 +59,9 @@ export class ProsemirrorService {
     update(text: string) {
         if (this.editorView) {
             const state = this.getStateFromText(text);
-            this.editorView.updateState(state);
+            if (document.body.contains(this.editorView.dom)) {
+                this.editorView.updateState(state);
+            }
         }
     }