@@ -164,12 +164,9 @@ const Overlay = React.forwardRef<HTMLDivElement>((_, ref) => {
164
164
position : strategy ,
165
165
inset : 0 ,
166
166
transitionProperty : 'opacity' ,
167
- transitionTimingFunction : transitionTiming . slowBezier ,
168
- } ,
169
- duration : {
170
- open : transitionDurationValues . slower ,
171
- close : transitionDurationValues . slow ,
167
+ transitionTimingFunction : transitionTiming . bezier ,
172
168
} ,
169
+ duration : transitionDurationValues . drawer ,
173
170
} ) ;
174
171
175
172
if ( ! isMounted ) return null ;
@@ -202,19 +199,14 @@ const Content = React.forwardRef<HTMLDivElement, ContentProps>(({ children }, re
202
199
const mergedRefs = useMergeRefs ( [ ref , refs . setFloating ] ) ;
203
200
204
201
const { isMounted, styles : transitionStyles } = useTransitionStyles ( context , {
205
- initial : { transform : 'translateX(100%)' } ,
206
- open : { transform : 'translateX( 0)' } ,
207
- close : { transform : 'translateX(100%)' } ,
202
+ initial : { transform : `translate3d(var(--transform-offset), 0, 0)` } ,
203
+ open : { transform : 'translate3d(0, 0, 0)' } ,
204
+ close : { transform : `translate3d(var(--transform-offset), 0, 0)` } ,
208
205
common : {
209
206
transitionProperty : 'transform' ,
210
- transitionTimingFunction : transitionTiming . slowBezier ,
207
+ transitionTimingFunction : transitionTiming . bezier ,
211
208
} ,
212
- duration : isMotionSafe
213
- ? {
214
- open : transitionDurationValues . slower ,
215
- close : transitionDurationValues . slow ,
216
- }
217
- : 0 ,
209
+ duration : isMotionSafe ? transitionDurationValues . drawer : 0 ,
218
210
} ) ;
219
211
220
212
if ( ! isMounted ) return null ;
@@ -234,6 +226,11 @@ const Content = React.forwardRef<HTMLDivElement, ContentProps>(({ children }, re
234
226
style = { transitionStyles }
235
227
direction = 'col'
236
228
sx = { t => ( {
229
+ // Apply the conditional right offset + the spread of the
230
+ // box shadow to ensure it is fully offscreen before unmounting
231
+ '--transform-offset' :
232
+ strategy === 'fixed' ? `calc(100% + ${ t . space . $3 } + ${ t . space . $8x75 } )` : `calc(100% + ${ t . space . $8x75 } )` ,
233
+ willChange : 'transform' ,
237
234
position : strategy ,
238
235
insetBlock : strategy === 'fixed' ? t . space . $3 : 0 ,
239
236
insetInlineEnd : strategy === 'fixed' ? t . space . $3 : 0 ,
0 commit comments