diff --git a/app/components/SimpleEditor/Editor.js b/app/components/SimpleEditor/Editor.js index 4633a5df045fd9f8482825be11e77aa48aa0bd4c..27239f72a5515e5fbb80323e165e5be39cf68728 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 dff5a96509d303b48f6dda09340f58e9621efdf2..05cbd0a49475b97f532e6843851835ca5a0aa881 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