Skip to content
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

Allow reading range from DOM when editor is disabled #476

Merged
merged 1 commit into from
Aug 30, 2016

Conversation

bantic
Copy link
Collaborator

@bantic bantic commented 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

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 bantic force-pushed the fix-bug-where-moving-a-card-in-non-editable-errors branch from 3416431 to de0b954 Compare August 30, 2016 18:31
@bantic bantic merged commit 6969f5c into master Aug 30, 2016
@bantic bantic deleted the fix-bug-where-moving-a-card-in-non-editable-errors branch August 30, 2016 18:45
@bantic
Copy link
Collaborator Author

bantic commented Aug 31, 2016

released in v0.10.9

johnelliott pushed a commit to dailybeast/mobiledoc-kit that referenced this pull request 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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant