slate-yjs
slate-yjs copied to clipboard
Empty text node added when replacing the doc content with the new content
Discussed in https://github.com/BitPhinix/slate-yjs/discussions/387
Originally posted by Maryam-Yumna April 11, 2023 There's an extra empty text node added everytime i try to delete all the content in a shared type and insert new content
const versionContent = [
{
"type": "p",
"id": 1681200966756,
"children": [
{
"text": "hi"
}
]
}
]
sharedType.delete(0, sharedType.length);
const delta = slateNodesToInsertDelta(versionContent);
sharedType.applyDelta(delta);
//expected
[
{
"type": "p",
"id": 1681200966756,
"children": [
{
"text": "hi"
}
]
]
//result I get
[
{
"type": "p",
"id": 1681200966756,
"children": [
{
"text": "hi"
}
]
},
{
"type": "p",
"children": [
{
"text": ""
}
]
}
]
```</div>
Duplicate of https://github.com/BitPhinix/slate-yjs/issues/385
Nvm, could you provide a repo with a reproduction case?