From d78c82f990695d8f2b254a71d4dbabe6d5886b7c Mon Sep 17 00:00:00 2001 From: liaoxuezhi <2betop.cn@gmail.com> Date: Wed, 23 Aug 2023 17:50:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E4=B8=8B=E7=9B=B4=E6=8E=A5=E7=94=A8=20formitem=20=E4=B8=8D?= =?UTF-8?q?=E5=8C=85=E8=A3=B9=20form=20=E7=9A=84=E5=9C=BA=E6=99=AF?= =?UTF-8?q?=E4=B8=8B=E5=BC=B9=E7=AA=97=E6=8F=90=E4=BA=A4=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=B8=8D=E7=AC=A6=E5=90=88=E9=A2=84=E6=9C=9F=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20(#7913)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/amis-core/src/store/node.ts | 2 +- .../__snapshots__/dialog.test.tsx.snap | 28 +++---- .../__tests__/event-action/dialog.test.tsx | 82 ++++++++++++++++++- packages/amis/src/renderers/Dialog.tsx | 13 ++- 4 files changed, 103 insertions(+), 22 deletions(-) diff --git a/packages/amis-core/src/store/node.ts b/packages/amis-core/src/store/node.ts index 23ac261c2..35d584611 100644 --- a/packages/amis-core/src/store/node.ts +++ b/packages/amis-core/src/store/node.ts @@ -60,7 +60,7 @@ export const StoreNode = types callback?.(); } else if (!self.childrenIds.length) { const parent = self.parentStore; - parent?.onChildStoreDispose?.(self); + parent && isAlive(parent) && parent.onChildStoreDispose(self); destroy(self); callback?.(); // destroy(self); diff --git a/packages/amis/__tests__/event-action/__snapshots__/dialog.test.tsx.snap b/packages/amis/__tests__/event-action/__snapshots__/dialog.test.tsx.snap index f9a188a7f..b93248763 100644 --- a/packages/amis/__tests__/event-action/__snapshots__/dialog.test.tsx.snap +++ b/packages/amis/__tests__/event-action/__snapshots__/dialog.test.tsx.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`EventAction:dialog 1`] = ` +exports[`1. EventAction:dialog args 1`] = `