Skip to content

Commit

Permalink
fix: the onOpenChange event for the modal component does not work as …
Browse files Browse the repository at this point in the history
…expected
  • Loading branch information
anncwb committed Sep 18, 2024
1 parent 2c22825 commit c81c179
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions internal/vite-config/src/config/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ function createCssOptions(injectGlobalScss = true) {
}
return content;
},
api: 'modern-compiler',
},
}
: {},
Expand Down
8 changes: 4 additions & 4 deletions packages/@core/ui-kit/popup-ui/src/drawer/use-drawer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions packages/@core/ui-kit/popup-ui/src/modal/use-modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c81c179

Please sign in to comment.