Skip to content

[drawer] Ignore the page scroller when starting a swipe - #5567

Merged
atomiks merged 3 commits into
mui:masterfrom
flaviendelangle:drawer-page-scroll-swipe
Aug 26, 2026
Merged

[drawer] Ignore the page scroller when starting a swipe#5567
atomiks merged 3 commits into
mui:masterfrom
flaviendelangle:drawer-page-scroll-swipe

Conversation

@flaviendelangle

@flaviendelangle flaviendelangle commented Aug 25, 2026

Copy link
Copy Markdown
Member

Closes #5566

useSwipeDismiss looks for a scrollable element between the touch target and document.body, and refuses to start (or gates the start on the scroll edge) when it finds one. That search also tests body itself. With a reset such as html, body { height: 100%; overflow: auto }, body is a real scroll container, so a non-modal drawer on a long page can be swiped down but not back up from a lower snap point. Drawer.Viewport already treats body and documentElement as "no scroll container" in its native touchmove handler, so this makes the hook do the same. The page scroller is filtered per axis, so a genuine inner scroller on the other axis still gates the gesture.

The added Chromium test reproduces the reset and fails before the change.

@pkg-pr-new

pkg-pr-new Bot commented Aug 25, 2026

Copy link
Copy Markdown

commit: 0877f1b

@netlify

netlify Bot commented Aug 25, 2026

Copy link
Copy Markdown

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 0877f1b
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6a8e8aa65af9fd0008db2c02
😎 Deploy Preview https://deploy-preview-5567--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@code-infra-dashboard

code-infra-dashboard Bot commented Aug 25, 2026

Copy link
Copy Markdown

Bundle size

Bundle Parsed size Gzip size
@base-ui/react 🔺+63B(+0.01%) 🔺+25B(+0.02%)

Details of bundle changes

Performance

Total duration: 1,240.92 ms +119.69 ms(+10.7%) | Renders: 76 (+0) | Paint: 1,980.36 ms +148.31 ms(+8.1%)

Test Duration Renders
Tabs mount (200 instances) 263.89 ms 🔺+64.08 ms(+32.1%) 3 (+0)
Menu mount (300 instances) 98.44 ms 🔺+17.98 ms(+22.3%) 1 (+0)
Select open (500 options) 55.47 ms 🔺+11.53 ms(+26.3%) 14 (+0)

12 tests within noise — details

Metric alarms

Test Metric Change
Tabs mount (200 instances) bench:paint 🔺 +72.17 ms

Check out the code infra dashboard for more information about this PR.

@flaviendelangle flaviendelangle self-assigned this Aug 25, 2026
@flaviendelangle flaviendelangle added type: bug It doesn't behave as expected. component: drawer Changes related to the drawer component. labels Aug 25, 2026
@atomiks
atomiks force-pushed the drawer-page-scroll-swipe branch from 94ad5ae to 0877f1b Compare August 26, 2026 06:41
@atomiks
atomiks merged commit 6f53fd8 into mui:master Aug 26, 2026
24 checks passed
@flaviendelangle
flaviendelangle deleted the drawer-page-scroll-swipe branch August 26, 2026 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: drawer Changes related to the drawer component. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[drawer] Non-modal drawer with snapPoints can't be swiped up from a lower snap point when the page is scrollable

2 participants