Skip to content

Commit

Permalink
Fixing incorrect deletion in case of embed blot slab#3568
Browse files Browse the repository at this point in the history
  • Loading branch information
mattheusbr committed Feb 12, 2024
1 parent 22aff73 commit 2e74812
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions core/selection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,13 @@ class Selection {
const blot = this.scroll.find(node, true);
// @ts-expect-error Fix me later
const index = blot.offset(this.scroll);
if (offset === 0) {
return index;
}
if (blot instanceof LeafBlot) {
return index + blot.index(node, offset);
}
//https://github.com/quilljs/quill/pull/3568
if (offset === 0) {
return index;
}
// @ts-expect-error Fix me later
return index + blot.length();
});
Expand Down

0 comments on commit 2e74812

Please sign in to comment.