From f5ea6d7cc36140f6de4557a8d2500f4460f624b9 Mon Sep 17 00:00:00 2001
From: barlas <yannisbarlas@gmail.com>
Date: Mon, 20 Mar 2017 15:38:17 +0200
Subject: [PATCH] dispose substance drag manage to let react dnd to work

---
 app/components/SimpleEditor/Editor.js        | 4 ++++
 app/components/SimpleEditor/SimpleEditor.jsx | 4 +++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/app/components/SimpleEditor/Editor.js b/app/components/SimpleEditor/Editor.js
index 4633a5d..27239f7 100644
--- a/app/components/SimpleEditor/Editor.js
+++ b/app/components/SimpleEditor/Editor.js
@@ -275,6 +275,10 @@ class Editor extends ProseEditor {
       trackChangesProvider
     }
   }
+
+  dispose () {
+    this.editorSession.dragManager.dispose()
+  }
 }
 
 export default Editor
diff --git a/app/components/SimpleEditor/SimpleEditor.jsx b/app/components/SimpleEditor/SimpleEditor.jsx
index dff5a96..05cbd0a 100644
--- a/app/components/SimpleEditor/SimpleEditor.jsx
+++ b/app/components/SimpleEditor/SimpleEditor.jsx
@@ -152,7 +152,7 @@ export default class SimpleEditor extends React.Component {
       config: configurator.config
     })
 
-    Editor.mount({
+    this.editor = Editor.mount({
       book,
       configurator,
       containerId,
@@ -174,6 +174,8 @@ export default class SimpleEditor extends React.Component {
   componentWillUnmount () {
     this._releaseLock()
     window.removeEventListener('beforeunload', this._releaseLock)
+
+    this.editor.dispose()
   }
 
   // TODO -- use this for correctly refreshing props when the fragment arrives
-- 
GitLab