diff --git a/src/Dialog/Content/index.tsx b/src/Dialog/Content/index.tsx index 7d98fc32..7e6fc208 100644 --- a/src/Dialog/Content/index.tsx +++ b/src/Dialog/Content/index.tsx @@ -37,7 +37,8 @@ const Content = React.forwardRef((props, ref) => { contentStyle.transformOrigin = transformOrigin; } - function onPrepare() { + function onPrepare(dialog) { + dialog.style.display = null; const elementOffset = offset(dialogRef.current); setTransformOrigin( @@ -47,6 +48,10 @@ const Content = React.forwardRef((props, ref) => { ); } + function onLeave(dialog) { + dialog.style.display = 'none'; + } + // ============================= Render ============================= return ( ((props, ref) => { forceRender={forceRender} motionName={motionName} removeOnLeave={destroyOnClose} + onLeaveEnd={onLeave} ref={dialogRef} > {({ className: motionClassName, style: motionStyle }, motionRef) => (