1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-20 22:21:20 +02:00

Fix rendering of collapsed annotation at offset zero. (#2918)

This commit is contained in:
themithy
2019-08-22 04:39:58 +02:00
committed by Ian Storm Taylor
parent 2ea6d40ad0
commit 9a2b53e81c

View File

@@ -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
}