Fix case when property 'observer' in modificationObserver is not defined (#866)

This commit is contained in:
VladimirZhdanov 2019-09-08 00:02:49 +06:00 committed by Peter Savchenko
parent d22667df62
commit e2ca2a6de9
3 changed files with 8 additions and 5 deletions

8
dist/editor.js vendored

File diff suppressed because one or more lines are too long

View file

@ -6,6 +6,7 @@
- `Refactoring` — Created universal Flipper class that responses for navigation by keyboard inside of any Toolbars
- `Fix` — First CMD+A on block with now uses default behaviour. Fixed problem with second CMD+A after selection clearing [#827](https://github.com/codex-team/editor.js/issues/827)
- `Improvements` — Style of inline selection and selected blocks improved
- `Fix` - Fixed problem when property 'observer' in modificationObserver is not defined
### 2.15

View file

@ -47,7 +47,9 @@ export default class ModificationsObserver extends Module {
*/
public destroy() {
this.mutationDebouncer = null;
this.observer.disconnect();
if (this.observer) {
this.observer.disconnect();
}
this.observer = null;
this.nativeInputs.forEach((input) => this.Editor.Listeners.off(input, 'input', this.mutationDebouncer));
}