From f088bca883206704d5616ad4e63a0b3d1271101c Mon Sep 17 00:00:00 2001 From: Sodbileg Gansukh Date: Fri, 12 Apr 2024 13:22:44 +0800 Subject: [PATCH] Fixed esc handler behavior on preview and advanced theme modals (#20014) ref DES-26, DES-57 --- apps/admin-x-design-system/src/global/modal/PreviewModal.tsx | 1 + .../src/components/settings/site/ThemeModal.tsx | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/apps/admin-x-design-system/src/global/modal/PreviewModal.tsx b/apps/admin-x-design-system/src/global/modal/PreviewModal.tsx index 6be3328391..7b70798cb6 100644 --- a/apps/admin-x-design-system/src/global/modal/PreviewModal.tsx +++ b/apps/admin-x-design-system/src/global/modal/PreviewModal.tsx @@ -265,6 +265,7 @@ export const PreviewModalContent: React.FC = ({ afterClose={afterClose} animate={false} backDropClick={backDropClick} + dirty={dirty} footer={false} height={height} padding={false} diff --git a/apps/admin-x-settings/src/components/settings/site/ThemeModal.tsx b/apps/admin-x-settings/src/components/settings/site/ThemeModal.tsx index 1684e3a925..688f00ec91 100644 --- a/apps/admin-x-settings/src/components/settings/site/ThemeModal.tsx +++ b/apps/admin-x-settings/src/components/settings/site/ThemeModal.tsx @@ -468,6 +468,10 @@ const ChangeThemeModal: React.FC = ({source, themeRef}) = testId='theme-modal' title='' scrolling + onCancel={() => { + modal.remove(); + updateRoute(''); + }} >