Skip to content

Commit

Permalink
Fix rendering of collapsed annotation at offset zero. (ianstormtaylor…
Browse files Browse the repository at this point in the history
  • Loading branch information
themithy authored and ianstormtaylor committed Aug 22, 2019
1 parent 2ea6d40 commit 9a2b53e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/slate/src/models/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,11 @@ class Text extends Record(DEFAULTS) {
}

// If the range starts after the leaf, or ends before it, continue.
if (start.offset > offset + length || end.offset <= offset) {
if (
start.offset > offset + length ||
end.offset < offset ||
(end.offset === offset && offset !== 0)
) {
next.push(leaf)
continue
}
Expand Down

0 comments on commit 9a2b53e

Please sign in to comment.