Skip to content

[drawer] Fix touch scroll in portaled popups - #4382

Merged
atomiks merged 2 commits into
mui:masterfrom
atomiks:codex/fix-drawer-portaled-touch-scroll
Mar 20, 2026
Merged

atomiks merged 2 commits into
mui:masterfrom
atomiks:codex/fix-drawer-portaled-touch-scroll

Conversation

@atomiks

@atomiks atomiks commented Mar 19, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #4380

Summary

This prevents Drawer touch-swipe bookkeeping from starting when a touch event originates from a React-portaled surface outside the drawer viewport DOM. That keeps mobile touch scrolling working for popup content such as Combobox and Select inside a Drawer.

Changes

  • Bail out of DrawerViewport touch tracking when the touch target is outside the viewport or popup DOM subtree.
  • Add a low-level regression for portaled descendants to assert drawer touch handling no longer cancels native touchmove.
  • Add a browser-only Combobox-in-Drawer regression to cover the reported touch interaction without starting drawer swipe dismissal.

@atomiks atomiks added type: bug It doesn't behave as expected. component: drawer Changes related to the drawer component. mobile Targets mobile platform. browser: Safari Affects or fixes behavior in Apple Safari. labels Mar 19, 2026
@atomiks

atomiks commented Mar 19, 2026

Copy link
Copy Markdown
Contributor Author

Codex Review

Overview

This patch updates Drawer's touch handling so portaled popups inside a drawer are not mistaken for swipe-dismiss content. It also adds focused regressions for the low-level portal event path and the reported Combobox-in-Drawer interaction.

Findings (None)

No blocking issues found in this patch.

Confidence: 4/5

High confidence based on a full pass over the touched drawer logic, the new regression coverage, and focused verification in both JSDOM and Chromium. Residual risk is mainly that browser-mode touch tests still exercise synthetic pointer events rather than a fully native mobile gesture pipeline.

Notes

  • Verified with pnpm test:jsdom DrawerViewport --no-watch and pnpm test:chromium DrawerViewport --no-watch.

@pkg-pr-new

pkg-pr-new Bot commented Mar 19, 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@4382
    
    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/utils@4382
    

commit: 9b959b3

@mui-bot

mui-bot commented Mar 19, 2026 •

Copy link
Copy Markdown

Bundle size report

Bundle Parsed size Gzip size
@base-ui/react 🔺+49B(+0.01%) 🔺+5B(0.00%)

Details of bundle changes


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

@netlify

netlify Bot commented Mar 19, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 9b959b3
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/69bd26978f006f000739e70e
😎 Deploy Preview https://deploy-preview-4382--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@atomiks atomiks removed the browser: Safari Affects or fixes behavior in Apple Safari. label Mar 20, 2026
@atomiks
atomiks force-pushed the codex/fix-drawer-portaled-touch-scroll branch 2 times, most recently from e4653bb to d20ee53 Compare March 20, 2026 10:43
@atomiks
atomiks force-pushed the codex/fix-drawer-portaled-touch-scroll branch from d20ee53 to c2ce81c Compare March 20, 2026 10:44
@atomiks
atomiks marked this pull request as ready for review March 20, 2026 11:04
@atomiks
atomiks merged commit a9cc196 into mui:master Mar 20, 2026
7 checks passed
@atomiks
atomiks deleted the codex/fix-drawer-portaled-touch-scroll branch March 20, 2026 11:05
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. mobile Targets mobile platform. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[drawer] Prevents touch scrolling in portaled popups (Select, Combobox) on mobile

2 participants