Skip to content

Commit

Permalink
Merge pull request #1541 from binhtran92/LPS-166754
Browse files Browse the repository at this point in the history
fix: avoid null on init and destroy the editor too fast makes the DOM is not loaded
  • Loading branch information
dsanz authored Nov 4, 2022
2 parents a6e6b65 + 81959f0 commit 6628d94
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/adapter/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,15 @@ extend(
const nativeEditor = this.get('nativeEditor');
const isMSSelection = typeof window.getSelection != 'function';

if (isMSSelection) {
nativeEditor.document.$.selection.empty();
} else {
nativeEditor.document
.getWindow()
.$.getSelection()
.removeAllRanges();
if (nativeEditor.document) {
if (isMSSelection) {
nativeEditor.document.$.selection.empty();
} else {
nativeEditor.document
.getWindow()
.$.getSelection()
.removeAllRanges();
}
}
},

Expand Down

0 comments on commit 6628d94

Please sign in to comment.