diff --git a/libs/components/editor-blocks/src/blocks/text/TextView.tsx b/libs/components/editor-blocks/src/blocks/text/TextView.tsx index 5f55e6d64..d28218a17 100644 --- a/libs/components/editor-blocks/src/blocks/text/TextView.tsx +++ b/libs/components/editor-blocks/src/blocks/text/TextView.tsx @@ -113,13 +113,18 @@ export const TextView = ({ 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); diff --git a/libs/components/editor-core/src/editor/selection/selection.ts b/libs/components/editor-core/src/editor/selection/selection.ts index 5b5520bcf..38d7f86b0 100644 --- a/libs/components/editor-core/src/editor/selection/selection.ts +++ b/libs/components/editor-core/src/editor/selection/selection.ts @@ -690,7 +690,7 @@ export class SelectionManager implements VirgoSelection { this.emit(nodeId, SelectEventTypes.active, this.lastPoint); // TODO: Optimize the related logic after implementing the scroll bar setTimeout(() => { - // this._editor.scrollManager.keepBlockInView(node); + this._editor.scrollManager.keepBlockInView(node); }, this._scrollDelay); } else { console.warn('Can not find node by this id');