diff --git a/packages/engine-render/src/components/docs/text-selection/convert-cursor.ts b/packages/engine-render/src/components/docs/text-selection/convert-cursor.ts index d55db12f74b6..550a74dfd662 100644 --- a/packages/engine-render/src/components/docs/text-selection/convert-cursor.ts +++ b/packages/engine-render/src/components/docs/text-selection/convert-cursor.ts @@ -225,6 +225,11 @@ export class NodePositionConvertToCursor { this._selectionIterator(start, end, (start_sp, end_sp, isFirst, isLast, divide, line) => { const { lineHeight, marginTop, asc } = line; const { glyphGroup, st } = divide; + if (glyphGroup.length === 0) { + // The divide is empty, and no need to set selection. + // Handle the drawing which split the line, and the second divide is empty. + return; + } const { x: startX, y: startY } = this._liquid; let borderBoxPosition: IPosition;