Skip to content

Commit 6969f5c

Browse files
authored
fix(range) Allow reading range from DOM when editor is disabled (#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 #475
1 parent 235f7a3 commit 6969f5c

File tree

3 files changed

+76
-175
lines changed

3 files changed

+76
-175
lines changed

src/js/editor/editor.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -395,9 +395,6 @@ class Editor {
395395
}
396396

397397
_readRangeFromDOM() {
398-
if (!this.isEditable) {
399-
return;
400-
}
401398
this.range = this.cursor.offsets;
402399
}
403400

0 commit comments

Comments
 (0)