From 73457cb2e8cc693138e4785c382ae4c025d8fedd Mon Sep 17 00:00:00 2001 From: Hufe921 Date: Tue, 21 Mar 2023 17:58:41 +0800 Subject: [PATCH] fix:cannot copy table element when it in the first position --- src/editor/utils/element.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/editor/utils/element.ts b/src/editor/utils/element.ts index e0a5c93..095300d 100644 --- a/src/editor/utils/element.ts +++ b/src/editor/utils/element.ts @@ -295,12 +295,12 @@ export function zipElementList(payload: IElement[]): IElement[] { let e = 0 while (e < elementList.length) { let element = elementList[e] - // 筛选所需项 - if (e === 0 && element.value === ZERO) { + // 上下文首字符(占位符) + if (e === 0 && element.value === ZERO && (!element.type || element.type === ElementType.TEXT)) { e++ continue } - // 表格、超链接递归处理 + // 表格、超链接、日期、控件特殊处理 if (element.type === ElementType.TABLE) { if (element.trList) { for (let t = 0; t < element.trList.length; t++) {