mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-09 23:49:27 +08:00
fix: kanban and calendar block popup edit form didn't show 'Unsaved changes' warning (#6172)
This commit is contained in:
parent
26e69acaf5
commit
ab6b43745f
@ -23,6 +23,7 @@ export const PopupContextProvider: React.FC<{
|
|||||||
}> = (props) => {
|
}> = (props) => {
|
||||||
const { visible: visibleFromProps, setVisible: setVisibleFromProps } = props;
|
const { visible: visibleFromProps, setVisible: setVisibleFromProps } = props;
|
||||||
const [visible, setVisible] = useState(false);
|
const [visible, setVisible] = useState(false);
|
||||||
|
const [formValueChanged, setFormValueChanged] = useState(false);
|
||||||
const { visible: visibleWithURL, setVisible: setVisibleWithURL } = useContext(PopupVisibleProviderContext) || {
|
const { visible: visibleWithURL, setVisible: setVisibleWithURL } = useContext(PopupVisibleProviderContext) || {
|
||||||
visible: false,
|
visible: false,
|
||||||
setVisible: () => {},
|
setVisible: () => {},
|
||||||
@ -46,6 +47,8 @@ export const PopupContextProvider: React.FC<{
|
|||||||
setVisible={_setVisible}
|
setVisible={_setVisible}
|
||||||
openMode={openMode}
|
openMode={openMode}
|
||||||
openSize={openSize}
|
openSize={openSize}
|
||||||
|
formValueChanged={formValueChanged}
|
||||||
|
setFormValueChanged={setFormValueChanged}
|
||||||
>
|
>
|
||||||
{props.children}
|
{props.children}
|
||||||
</ActionContextProvider>
|
</ActionContextProvider>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user