Repository navigation
[drawer] Make data-base-ui-swipe-ignore explicit for touch interactions - #4295
Conversation
Codex ReviewOverviewThis patch makes swipe opt-out explicit with Findings (None)No blocking issues found in this patch. Confidence: 5/5High confidence after a full review of the branch diff against Notes
|
commit: |
Bundle size report
Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
data-swipe-ignore explicit for touch interactionsdata-base-ui-swipe-ignore explicit for touch interactions
b035755 to
bb4641f
Compare
bb4641f to
378f220
Compare
e070f6a to
e392b53
Compare
|
Thanks @atomiks :D |
Touch swipes skipped buttons, links, labels and fields, so drawers built from them (nav links, action sheets, checkbox rows) could not be dragged. Port Base UI's behavior: touch ignores the interactive-element selector (`ignoreSelectorWhenTouch: false`) and only keeps range inputs out, while mouse and pen still skip interactive elements. Add `data-reka-swipe-ignore` to opt an element out for every input type (mui/base-ui#4295). Closes #2907 Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Fixes #4294
Summary
This changes swipe-ignore handling so Drawer and Toast use the namespaced
data-base-ui-swipe-ignoreattribute, while Toast still accepts the legacydata-swipe-ignorealias for compatibility.For Drawer specifically:
Drawer.Contentno longer auto-adds a public swipe-ignore attribute.Drawer.Contentstill fireonClickwithout requiringdata-base-ui-swipe-ignore.data-base-ui-swipe-ignorenow acts as the explicit opt-out for swipe dismissal, matching the Vaul-style behavior for the full touch gesture.Drawer.Contentstill avoid swipe handling so text selection keeps working.The patch also adds focused regression coverage for Drawer and Toast, updates the docs, and includes a small private experiment page for manual touch testing.