Skip to content

Commit

Permalink
fix #1514
Browse files Browse the repository at this point in the history
  • Loading branch information
jhchen committed Jul 17, 2017
1 parent c4b357a commit e780919
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ class Selection {
});
this.root.addEventListener('compositionend', () => {
this.composing = false;
if (this.cursor.parent) {
const range = this.cursor.restore();
if (!range) return;
setTimeout(() => {
this.setNativeRange(range.startNode, range.startOffset, range.endNode, range.endOffset);
}, 1);
}
});
this.cursor = Parchment.create('cursor', this);
// savedRange is last non-null range
Expand Down

0 comments on commit e780919

Please sign in to comment.