Skip to content

Commit

Permalink
save last native range
Browse files Browse the repository at this point in the history
  • Loading branch information
jhchen committed Apr 10, 2020
1 parent 9f9f8b3 commit 9361535
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class Selection {
// savedRange is last non-null range
this.savedRange = new Range(0, 0);
this.lastRange = this.savedRange;
this.lastNative = null;
this.handleComposition();
this.handleDragging();
this.emitter.listenDOM('selectionchange', document, () => {
Expand Down Expand Up @@ -372,6 +373,7 @@ class Selection {
const oldRange = this.lastRange;
const [lastRange, nativeRange] = this.getRange();
this.lastRange = lastRange;
this.lastNative = nativeRange;
if (this.lastRange != null) {
this.savedRange = this.lastRange;
}
Expand Down

0 comments on commit 9361535

Please sign in to comment.