Skip to content

[drawer] Skip touchmove listener while closed - #5864

Merged
atomiks merged 2 commits into
mui:masterfrom
atomiks:claude/affectionate-shtern-a4caf7
Oct 5, 2026
Merged

atomiks merged 2 commits into
mui:masterfrom
atomiks:claude/affectionate-shtern-a4caf7

Conversation

@atomiks

@atomiks atomiks commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

A closed <Drawer.Portal keepMounted> keeps a document-level touchmove listener registered with { passive: false, capture: true } for as long as the page is open. The open/mounted checks only ran inside the handler, so the listener stayed attached while the drawer was closed, and every touch scroll on the page had to wait for the main thread.

This PR registers the listener only while the drawer is open and mounted. The handler already did nothing while closed, so behavior is unchanged. It also adds a test that checks no non-passive touchmove listener exists while a keepMounted drawer is closed.

@atomiks atomiks added type: bug It doesn't behave as expected. component: drawer Changes related to the drawer component. labels Oct 2, 2026
@pkg-pr-new

pkg-pr-new Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
  • base-ui-tanstack-start

  • vite-css-base-ui-example

    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/react@5864
    
    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/utils@5864
    

commit: 5ba8e28

@code-infra-dashboard

code-infra-dashboard Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Bundle size

Bundle Parsed size Gzip size
@base-ui/react 0B(0.00%) 🔺+3B(0.00%)

Details of bundle changes

Performance

Total duration: 436.52 ms +11.29 ms(+2.7%) | Renders: 76 (+0) | Paint: 793.33 ms +6.62 ms(+0.8%)

Test Duration Renders
Checkbox mount (500 instances) 36.04 ms 🔺+6.47 ms(+21.9%) 1 (+0)
Select open (500 options) 25.04 ms ▼-6.92 ms(-21.6%) 14 (+0)
Menu mount (300 instances) 20.69 ms ▼-6.10 ms(-22.8%) 1 (+0)
Tooltip mount (300 contained roots) 15.74 ms ▼-4.52 ms(-22.3%) 1 (+0)

11 tests within noise — details


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

@netlify

netlify Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 5ba8e28
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6ac30bc38469a20008e8a91c
😎 Deploy Preview https://deploy-preview-5864--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.

@atomiks
atomiks marked this pull request as ready for review October 2, 2026 05:03
@atomiks
atomiks force-pushed the claude/affectionate-shtern-a4caf7 branch from 432e42a to 5ba8e28 Compare October 5, 2026 02:30
@atomiks
atomiks merged commit 75bcafc into mui:master Oct 5, 2026
24 checks passed
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.

1 participant