Skip to content

Commit

Permalink
fix(range) Allow reading range from DOM when editor is disabled (#476)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bantic committed Aug 30, 2016
1 parent 235f7a3 commit 6969f5c
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 175 deletions.
3 changes: 0 additions & 3 deletions src/js/editor/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,6 @@ class Editor {
}

_readRangeFromDOM() {
if (!this.isEditable) {
return;
}
this.range = this.cursor.offsets;
}

Expand Down
Loading

0 comments on commit 6969f5c

Please sign in to comment.