Skip to content

fix(web): detached/form slide-in, scroll, footer click, grabber#684

Merged
lodev09 merged 6 commits into
mainfrom
fix/web-detached-slide-animation
May 12, 2026
Merged

fix(web): detached/form slide-in, scroll, footer click, grabber#684
lodev09 merged 6 commits into
mainfrom
fix/web-detached-slide-animation

Conversation

@lodev09
Copy link
Copy Markdown
Owner

@lodev09 lodev09 commented May 12, 2026

Summary

A handful of web-only fixes for detached/form-mode sheets:

  • Slide-in on autopresent: Content's wasOpenRef started as isOpen, so a mount with initialDetentIndex set saw no transition and snapped straight to rest. Initialize to false so the first render is detected as a false→true transition and runs the slide-up animation.
  • Scrollable content not scrolling: vaul wraps content in [data-vaul-auto-size-wrapper] (display: flow-root), which doesn't propagate height to descendant flex children. Wrap the scrollable branch's header + scroll container in an absolute-positioned flex column sized to calc(100% - var(--snap-point-height, 0px)) so the inner flex: 1 scroll area has a definite height.
  • Footer click dismissing the sheet: the footer renders as a vaul detachedSiblings sibling of Drawer.Content, so Radix treats clicks on it as outside. Detect clicks inside [data-vaul-detached-wrapper] in handleDismiss and preventDefault().
  • Grabber not draggable under header: bump grabber zIndex from 1 → 2 so absolute-positioned headers (which commonly use zIndex: 1) don't cover it — important when only the grabber can drag.
  • Drop scrollingExpandsSheethandleOnly mapping: removed, no longer needed after the scroll fix.

Type of Change

  • Bug fix

Test Plan

  • Tested on Web (detached/form mode autopresent slide-in)
  • Tested on Web (scrollable content scrolls inside the sheet)
  • Tested on Web (footer click does not dismiss)
  • Tested on Web (grabber draggable with overlaid header)

Checklist

  • I tested on iOS
  • I tested on Android
  • I tested on Web
  • I updated the documentation (if needed)
  • I added a changelog entry (if needed)

lodev09 added 5 commits May 13, 2026 03:11
vaul wraps Drawer.Content children in [data-vaul-auto-size-wrapper] with
display: flow-root, which doesn't honor descendant flex layout — the
scroll container's flex:1 had nothing to fill so it sized to content and
never overflowed.

When scrollable, wrap header + scroll container in an absolutely-
positioned flex column sized to the visible portion via
calc(100% - var(--snap-point-height, 0px)).
Footer is rendered via vaul's detachedSiblings as a sibling of
Drawer.Content inside [data-vaul-detached-wrapper], so Radix Dialog
treats pointerdowns on it as outside the content and dismisses.

Extend handlePointerDownOutside to also preventDefault when the target
is anywhere inside the detached wrapper.
Headers with zIndex:1 (a common pattern for absolute-positioned headers
that overlay scroll content) rendered later in DOM than the grabber and
stole its pointer events — leaving the sheet unable to expand in
`handleOnly` mode where only the grabber can drag.

Bump the grabber's zIndex to 2 so it stays above absolute headers.
The handleOnly mapping isn't the right semantics for
scrollingExpandsSheet=false. Drop it for now; the option becomes a no-op
on web until a proper mapping is figured out.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
react-native-true-sheet Ready Ready Preview, Comment May 12, 2026 10:17pm

Request Review

@lodev09 lodev09 merged commit bd0f398 into main May 12, 2026
6 checks passed
@lodev09 lodev09 deleted the fix/web-detached-slide-animation branch May 12, 2026 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant