From 239952e89ea2b2dc376811768f7ea27c545cd087 Mon Sep 17 00:00:00 2001 From: healtheloper Date: Mon, 13 Nov 2023 16:05:12 +0900 Subject: [PATCH 1/2] =?UTF-8?q?Drawer=20=EC=9D=98=20Transition=20=EC=9D=B4?= =?UTF-8?q?=EB=B2=A4=ED=8A=B8=EC=8B=9C=20=EC=99=B8=EB=B6=80=ED=95=A8?= =?UTF-8?q?=EC=88=98=EB=A5=BC=20=EC=A3=BC=EC=9E=85=ED=95=A0=EC=88=98=20?= =?UTF-8?q?=EC=9E=88=EB=8F=84=EB=A1=9D=20=EB=B3=80=EA=B2=BD=ED=96=88?= =?UTF-8?q?=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/Drawer/Drawer.tsx | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/packages/co-design-core/src/components/Drawer/Drawer.tsx b/packages/co-design-core/src/components/Drawer/Drawer.tsx index c15bb43..e5f98d7 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,20 @@ export const CoDrawer = ({ return ( lockScroll(false)} - onEntered={() => lockScroll(!noScrollLock && true)} + onExit={() => { + if (onExit) onExit(); + }} + onExited={() => { + lockScroll(false); + if (onExited) onExited(); + }} + onEnter={() => { + if (onEnter) onEnter(); + }} + onEntered={() => { + lockScroll(!noScrollLock && true); + if (onEntered) onEntered(); + }} mounted={opened} transitions={{ overlay: { duration: transitionDuration / 2, transition: 'fade', timingFunction: 'ease' }, From 29092c43ddfe5ce2b88ea5d3d7ff224f10dfe010 Mon Sep 17 00:00:00 2001 From: healtheloper Date: Mon, 13 Nov 2023 16:22:35 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=EB=B6=88=ED=95=84=EC=9A=94=ED=95=9C=20?= =?UTF-8?q?=EC=A1=B0=EA=B1=B4=EB=AC=B8=20=EC=82=AD=EC=A0=9C=ED=96=88?= =?UTF-8?q?=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/co-design-core/src/components/Drawer/Drawer.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/co-design-core/src/components/Drawer/Drawer.tsx b/packages/co-design-core/src/components/Drawer/Drawer.tsx index e5f98d7..05c070d 100644 --- a/packages/co-design-core/src/components/Drawer/Drawer.tsx +++ b/packages/co-design-core/src/components/Drawer/Drawer.tsx @@ -151,16 +151,12 @@ export const CoDrawer = ({ return ( { - if (onExit) onExit(); - }} + onExit={onExit} onExited={() => { lockScroll(false); if (onExited) onExited(); }} - onEnter={() => { - if (onEnter) onEnter(); - }} + onEnter={onEnter} onEntered={() => { lockScroll(!noScrollLock && true); if (onEntered) onEntered();