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;
|
||||
},
|
||||
api: 'modern-compiler',
|
||||
},
|
||||
}
|
||||
: {},
|
||||
|
|
|
@ -54,10 +54,10 @@ export function useVbenDrawer<
|
|||
...options,
|
||||
} as DrawerApiOptions;
|
||||
|
||||
// mergedOptions.onOpenChange = (isOpen: boolean) => {
|
||||
// options.onOpenChange?.(isOpen);
|
||||
// injectData.options?.onOpenChange?.(isOpen);
|
||||
// };
|
||||
mergedOptions.onOpenChange = (isOpen: boolean) => {
|
||||
options.onOpenChange?.(isOpen);
|
||||
injectData.options?.onOpenChange?.(isOpen);
|
||||
};
|
||||
const api = new DrawerApi(mergedOptions);
|
||||
|
||||
const extendedApi: ExtendedDrawerApi = api as never;
|
||||
|
|
|
@ -58,10 +58,10 @@ export function useVbenModal<TParentModalProps extends ModalProps = ModalProps>(
|
|||
...options,
|
||||
} as ModalApiOptions;
|
||||
|
||||
// mergedOptions.onOpenChange = (isOpen: boolean) => {
|
||||
// options.onOpenChange?.(isOpen);
|
||||
// injectData.options?.onOpenChange?.(isOpen);
|
||||
// };
|
||||
mergedOptions.onOpenChange = (isOpen: boolean) => {
|
||||
options.onOpenChange?.(isOpen);
|
||||
injectData.options?.onOpenChange?.(isOpen);
|
||||
};
|
||||
const api = new ModalApi(mergedOptions);
|
||||
|
||||
const extendedApi: ExtendedModalApi = api as never;
|
||||
|
|
Loading…
Reference in New Issue