fix: the onOpenChange event for the modal component does not work as expected (#4425)
parent
2c22825546
commit
834cb4c470
|
@ -112,6 +112,7 @@ function createCssOptions(injectGlobalScss = true) {
|
||||||
}
|
}
|
||||||
return content;
|
return content;
|
||||||
},
|
},
|
||||||
|
api: 'modern-compiler',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
: {},
|
: {},
|
||||||
|
|
|
@ -54,10 +54,10 @@ export function useVbenDrawer<
|
||||||
...options,
|
...options,
|
||||||
} as DrawerApiOptions;
|
} as DrawerApiOptions;
|
||||||
|
|
||||||
// mergedOptions.onOpenChange = (isOpen: boolean) => {
|
mergedOptions.onOpenChange = (isOpen: boolean) => {
|
||||||
// options.onOpenChange?.(isOpen);
|
options.onOpenChange?.(isOpen);
|
||||||
// injectData.options?.onOpenChange?.(isOpen);
|
injectData.options?.onOpenChange?.(isOpen);
|
||||||
// };
|
};
|
||||||
const api = new DrawerApi(mergedOptions);
|
const api = new DrawerApi(mergedOptions);
|
||||||
|
|
||||||
const extendedApi: ExtendedDrawerApi = api as never;
|
const extendedApi: ExtendedDrawerApi = api as never;
|
||||||
|
|
|
@ -58,10 +58,10 @@ export function useVbenModal<TParentModalProps extends ModalProps = ModalProps>(
|
||||||
...options,
|
...options,
|
||||||
} as ModalApiOptions;
|
} as ModalApiOptions;
|
||||||
|
|
||||||
// mergedOptions.onOpenChange = (isOpen: boolean) => {
|
mergedOptions.onOpenChange = (isOpen: boolean) => {
|
||||||
// options.onOpenChange?.(isOpen);
|
options.onOpenChange?.(isOpen);
|
||||||
// injectData.options?.onOpenChange?.(isOpen);
|
injectData.options?.onOpenChange?.(isOpen);
|
||||||
// };
|
};
|
||||||
const api = new ModalApi(mergedOptions);
|
const api = new ModalApi(mergedOptions);
|
||||||
|
|
||||||
const extendedApi: ExtendedModalApi = api as never;
|
const extendedApi: ExtendedModalApi = api as never;
|
||||||
|
|
Loading…
Reference in New Issue