diff --git a/packages/co-design-core/src/components/Drawer/Drawer.tsx b/packages/co-design-core/src/components/Drawer/Drawer.tsx index c15bb43..05c070d 100644 --- a/packages/co-design-core/src/components/Drawer/Drawer.tsx +++ b/packages/co-design-core/src/components/Drawer/Drawer.tsx @@ -76,6 +76,18 @@ export interface DrawerProps extends CoComponentProps, Omit = { @@ -108,6 +120,10 @@ export const CoDrawer = ({ onClose, className, overrideStyles, + onEnter, + onEntered, + onExit, + onExited, ...props }: DrawerProps) => { const { classes, cx, theme } = useStyles({ size, position }, { overrideStyles, name: 'Drawer' }); @@ -135,8 +151,16 @@ export const CoDrawer = ({ return ( lockScroll(false)} - onEntered={() => lockScroll(!noScrollLock && true)} + onExit={onExit} + onExited={() => { + lockScroll(false); + if (onExited) onExited(); + }} + onEnter={onEnter} + onEntered={() => { + lockScroll(!noScrollLock && true); + if (onEntered) onEntered(); + }} mounted={opened} transitions={{ overlay: { duration: transitionDuration / 2, transition: 'fade', timingFunction: 'ease' },