-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
moving cards in disabled editor can cause editor.range
to go out of sync
#475
Comments
bantic
added a commit
that referenced
this issue
Aug 30, 2016
Because `_readRangeFromDOM` doesn't do anything if the editor is non-editable, the editor may get stuck with a range that is pointing at a section that has been removed from the post. This causes the error seen when doing the `post.walkAllLeafSections` later in the snapshot code. The post is undefined because it is read off the card, but the card that the range points at has been removed. Fixes #475
bantic
added a commit
that referenced
this issue
Aug 30, 2016
Because `_readRangeFromDOM` doesn't do anything if the editor is non-editable, the editor may get stuck with a range that is pointing at a section that has been removed from the post. This causes the error seen when doing the `post.walkAllLeafSections` later in the snapshot code. The post is undefined because it is read off the card, but the card that the range points at has been removed. Fixes #475
bantic
added a commit
that referenced
this issue
Aug 30, 2016
Because `_readRangeFromDOM` doesn't do anything if the editor is non-editable, the editor may get stuck with a range that is pointing at a section that has been removed from the post. This causes the error seen when doing the `post.walkAllLeafSections` later in the snapshot code. The post is undefined because it is read off the card, but the card that the range points at has been removed. Fixes #475
johnelliott
pushed a commit
to dailybeast/mobiledoc-kit
that referenced
this issue
Feb 7, 2017
…le#476) Because `_readRangeFromDOM` doesn't do anything if the editor is non-editable, the editor may get stuck with a range that is pointing at a section that has been removed from the post. This causes the error seen when doing the `post.walkAllLeafSections` later in the snapshot code. The post is undefined because it is read off the card, but the card that the range points at has been removed. Fixes bustle#475
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In a disabled editor, the
_readRangeFromDOM
method no-ops. This can causeeditor.range
to stay cached on an old state. If that range references sections that have since been programmatically deleted from the post, unexpected errors can happen, for example when snapshotting the range (to add to the undo stack), therange.head.section
is expected to have apost
property, but if that section has been removed it no longer will. This causes an error in theposition#leafSectionIndex
code.The text was updated successfully, but these errors were encountered: