feat: fix backspeace

This commit is contained in:
SaikaSakura committed 2022-08-10 16:07:52 +08:00
1 parent 4c9f04bc1c
commit 8183552011
2 files changed
+15 -7

No files matched your search

@@ -112,13 +112,18 @@ export const TextView: FC<CreateTextView> = ({
block.id,
'end'
);
const value = [
...preNode.getProperty('text').value,
...block.getProperty('text').value,
];
await preNode.setProperty('text', {
value,
});
if (
block.getProperty('text').value[0] &&
block.getProperty('text').value[0]?.text !== ''
) {
const value = [
...preNode.getProperty('text').value,
...block.getProperty('text').value,
];
await preNode.setProperty('text', {
value,
});
}
await preNode.append(...children);
await block.remove();
editor.suspend(false);