fix: slate cannot get the start point in the node at path [0]

This commit is contained in:
lawvs committed 2022-08-16 13:23:46 +08:00
1 parent de0c53b1b2
commit 64952806b9
1 file changed
+5
@@ -605,6 +605,11 @@ class SlateUtils {
}
textChildren.push(child);
}
// If nothing, should preserve empty string
// Fix Slate Cannot get the start point in the node at path [0] because it has no start text node.
if (!textChildren.length) {
textChildren.push({ text: '' });
}
return textChildren;
}