From 7d2bb4fa791a2bb1f83a4f9b2951a7947efe001e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8A=9B=E7=9A=93?= Date: Tue, 25 May 2021 16:21:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20fieldId=20=E9=87=8D=E7=BD=AE=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E9=99=90=E5=AE=9A=E5=9C=A8=E5=90=8C=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=20doc,=20=E8=A7=A3=E5=86=B3=E5=A4=9A=20doc=20=E6=97=B6=20field?= =?UTF-8?q?Id=20=E9=87=8D=E5=A4=8D=E5=AF=BC=E8=87=B4=E9=87=8D=E7=BD=AE?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/designer/src/designer/designer.ts | 2 +- .../vision-polyfill/src/props-reducers/init-node-reducer.ts | 4 ++-- packages/vision-polyfill/src/utils/index.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/designer/src/designer/designer.ts b/packages/designer/src/designer/designer.ts index 3ecde7eab..5a418266d 100644 --- a/packages/designer/src/designer/designer.ts +++ b/packages/designer/src/designer/designer.ts @@ -233,7 +233,7 @@ export class Designer { private _dropLocation?: DropLocation; - dropLocation() { + get dropLocation() { return this._dropLocation; } diff --git a/packages/vision-polyfill/src/props-reducers/init-node-reducer.ts b/packages/vision-polyfill/src/props-reducers/init-node-reducer.ts index 031482f46..f5f5e66e0 100644 --- a/packages/vision-polyfill/src/props-reducers/init-node-reducer.ts +++ b/packages/vision-polyfill/src/props-reducers/init-node-reducer.ts @@ -14,10 +14,10 @@ export function initNodeReducer(props, node) { ...props, }; if (newProps.fieldId) { - const fieldIds = getCurrentFieldIds(); + const { doc, fieldIds } = getCurrentFieldIds(); // 全局的关闭 uniqueIdChecker 信号,在 ve-utils 中实现 - if (fieldIds.indexOf(props.fieldId) >= 0 && !(window as any).__disable_unique_id_checker__) { + if (doc === node.document && fieldIds.indexOf(props.fieldId) >= 0 && !(window as any).__disable_unique_id_checker__) { newProps.fieldId = undefined; } } diff --git a/packages/vision-polyfill/src/utils/index.ts b/packages/vision-polyfill/src/utils/index.ts index aca4a0154..c815eb5ac 100644 --- a/packages/vision-polyfill/src/utils/index.ts +++ b/packages/vision-polyfill/src/utils/index.ts @@ -10,7 +10,7 @@ export function getCurrentFieldIds() { fieldIds.push(fieldId); } }); - return fieldIds; + return { doc: designer?.currentDocument, fieldIds }; } export function invariant(check: any, message: string, thing?: any) {