You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, there is a bug that when using IME, delete character if there is bold/italic etc. would throw error and lose cursor. The console log is 'The given range isn't in document.' in 'selection.js' file.
Steps for Reproduction
Visit [quilljs.com]
Type something, then click Bold button.
Type using IME, and delete character
Expected behavior:
No error and not lose cursor Actual behavior:
Throw error and lose cursor
Platforms:
macOS Sierra 10.21
Chrome Canary 61.0.3162.0
Version:
Version 1.3.0
The text was updated successfully, but these errors were encountered:
But startNode is already removed from document. So the following error is occurred : The given range isn't in document.
Solution
In setTimeout() thread, check again whether this.cursor has a parent or not.
if(this.cursor.parent){constrange=this.cursor.restore();if(!range)return;setTimeout(()=>{if(this.cursor.parent){// Check again, because it's new thread.this.setNativeRange(range.startNode,range.startOffset,range.endNode,range.endOffset);}},1);}
smura
pushed a commit
to smura/quill
that referenced
this issue
Aug 21, 2018
Quill 2.0 has been released (announcement post) with many changes and fixes. If this is still an issue please create a new issue after reviewing our updated Contributing guide 🙏
Hi, there is a bug that when using IME, delete character if there is bold/italic etc. would throw error and lose cursor. The console log is 'The given range isn't in document.' in 'selection.js' file.
Steps for Reproduction
Expected behavior:
No error and not lose cursor
Actual behavior:
Throw error and lose cursor
Platforms:
macOS Sierra 10.21
Chrome Canary 61.0.3162.0
Version:
Version 1.3.0
The text was updated successfully, but these errors were encountered: