This commit is contained in:
DiamondThree
2022-08-04 19:05:17 +08:00
parent f490ad497b
commit 228bcd8c06

View File

@@ -99,7 +99,7 @@ export const TextView: FC<CreateTextView> = ({
if (!parentBlock) { if (!parentBlock) {
return false; return false;
} }
let preParent = await parentBlock.previousSibling(); const preParent = await parentBlock.previousSibling();
if (Protocol.Block.Type.group === parentBlock.type) { if (Protocol.Block.Type.group === parentBlock.type) {
const children = await block.children(); const children = await block.children();
const preNode = await block.physicallyPerviousSibling(); const preNode = await block.physicallyPerviousSibling();
@@ -130,8 +130,12 @@ export const TextView: FC<CreateTextView> = ({
); );
if (block.blockProvider.isEmpty()) { if (block.blockProvider.isEmpty()) {
await block.remove(); await block.remove();
let parentChild = await parentBlock.children(); const parentChild = await parentBlock.children();
if (!parentChild.length) { if (
parentBlock.type ===
Protocol.Block.Type.group &&
!parentChild.length
) {
await editor.selectionManager.setSelectedNodesIds( await editor.selectionManager.setSelectedNodesIds(
[preParent.id] [preParent.id]
); );