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

This commit is contained in:
lawvs 2022-08-16 13:21:46 +08:00
parent de0c53b1b2
commit 64952806b9

View File

@ -605,6 +605,11 @@ class SlateUtils {
} }
textChildren.push(child); 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; return textChildren;
} }