From ab6b43745f1b2862a63344c23e8fff93106c26ec Mon Sep 17 00:00:00 2001 From: Katherine Date: Thu, 6 Feb 2025 21:27:23 +0800 Subject: [PATCH] fix: kanban and calendar block popup edit form didn't show 'Unsaved changes' warning (#6172) --- .../core/client/src/modules/popup/PopupContextProvider.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/core/client/src/modules/popup/PopupContextProvider.tsx b/packages/core/client/src/modules/popup/PopupContextProvider.tsx index 55b69ee1f7..2b034a4477 100644 --- a/packages/core/client/src/modules/popup/PopupContextProvider.tsx +++ b/packages/core/client/src/modules/popup/PopupContextProvider.tsx @@ -23,6 +23,7 @@ export const PopupContextProvider: React.FC<{ }> = (props) => { const { visible: visibleFromProps, setVisible: setVisibleFromProps } = props; const [visible, setVisible] = useState(false); + const [formValueChanged, setFormValueChanged] = useState(false); const { visible: visibleWithURL, setVisible: setVisibleWithURL } = useContext(PopupVisibleProviderContext) || { visible: false, setVisible: () => {}, @@ -46,6 +47,8 @@ export const PopupContextProvider: React.FC<{ setVisible={_setVisible} openMode={openMode} openSize={openSize} + formValueChanged={formValueChanged} + setFormValueChanged={setFormValueChanged} > {props.children}