@@ -264,9 +264,16 @@ const TrueSheetComponent = forwardRef<TrueSheetMethods, TrueSheetProps>((props,
264264 borderBottomLeftRadius : detached ? DEFAULT_CORNER_RADIUS : 0 ,
265265 borderBottomRightRadius : detached ? DEFAULT_CORNER_RADIUS : 0 ,
266266 backgroundColor : backgroundColor as string ,
267- maxWidth : isLandscapeOrTablet ? ( maxContentWidth ?? DEFAULT_MAX_WIDTH ) : undefined ,
268- marginLeft : isLandscapeOrTablet ? ( anchor === 'left' ? anchorOffset : 'auto' ) : undefined ,
269- marginRight : isLandscapeOrTablet ? ( anchor === 'right' ? anchorOffset : 'auto' ) : undefined ,
267+ // When detached on desktop, the clip wrapper already handles horizontal
268+ // sizing/anchoring — letting the drawer fill the wrapper keeps its bottom
269+ // corners aligned with the wrapper's rounded clip (double-margin would
270+ // leave the drawer inset from the wrapper's rounded edge).
271+ maxWidth :
272+ isLandscapeOrTablet && ! detached ? ( maxContentWidth ?? DEFAULT_MAX_WIDTH ) : undefined ,
273+ marginLeft :
274+ isLandscapeOrTablet && ! detached ? ( anchor === 'left' ? anchorOffset : 'auto' ) : undefined ,
275+ marginRight :
276+ isLandscapeOrTablet && ! detached ? ( anchor === 'right' ? anchorOffset : 'auto' ) : undefined ,
270277 } ) ,
271278 [ backgroundColor , isLandscapeOrTablet , maxContentWidth , anchor , anchorOffset , detached ]
272279 ) ;
@@ -285,10 +292,30 @@ const TrueSheetComponent = forwardRef<TrueSheetMethods, TrueSheetProps>((props,
285292 maxWidth : isLandscapeOrTablet ? ( maxContentWidth ?? DEFAULT_MAX_WIDTH ) : undefined ,
286293 marginLeft : isLandscapeOrTablet ? ( anchor === 'left' ? anchorOffset : 'auto' ) : undefined ,
287294 marginRight : isLandscapeOrTablet ? ( anchor === 'right' ? anchorOffset : 'auto' ) : undefined ,
295+ // Footer lives outside the drawer's detached clip wrapper, so match its
296+ // rounded bottom here instead of inheriting it.
297+ borderBottomLeftRadius : detached ? DEFAULT_CORNER_RADIUS : undefined ,
298+ borderBottomRightRadius : detached ? DEFAULT_CORNER_RADIUS : undefined ,
299+ overflow : detached ? 'hidden' : undefined ,
288300 } ) ,
289301 [ isLandscapeOrTablet , maxContentWidth , anchor , anchorOffset , detached , detachedOffset ]
290302 ) ;
291303
304+ // On desktop the drawer is narrower than the viewport, so the clip wrapper's
305+ // rounded bottom must match the drawer's horizontal bounds — otherwise its
306+ // corners sit at the far viewport edges and the drawer appears flat-bottomed.
307+ const detachedWrapperStyle = useMemo < React . CSSProperties | undefined > (
308+ ( ) =>
309+ detached && isLandscapeOrTablet
310+ ? {
311+ maxWidth : maxContentWidth ?? DEFAULT_MAX_WIDTH ,
312+ marginLeft : anchor === 'left' ? anchorOffset : 'auto' ,
313+ marginRight : anchor === 'right' ? anchorOffset : 'auto' ,
314+ }
315+ : undefined ,
316+ [ detached , isLandscapeOrTablet , maxContentWidth , anchor , anchorOffset ]
317+ ) ;
318+
292319 const handleStyle = useMemo < React . CSSProperties > (
293320 ( ) => ( {
294321 height : grabberHeight ,
@@ -313,6 +340,7 @@ const TrueSheetComponent = forwardRef<TrueSheetMethods, TrueSheetProps>((props,
313340 detached = { detached }
314341 detachedOffset = { detachedOffset }
315342 detachedRadius = { DEFAULT_CORNER_RADIUS }
343+ detachedWrapperStyle = { detachedWrapperStyle }
316344 activeSnapPoint = { activeSnapPoint }
317345 setActiveSnapPoint = { handleSetActiveSnapPoint }
318346 { ...snapPointsProps }
0 commit comments