Skip to content

Conversation

@atomiks
Copy link
Contributor

@atomiks atomiks commented Oct 18, 2025

Fixes #3008

This ensures pressing on nested children (in the React tree) doesn't dismiss on pointermove (swiping/scrolling) by using the capture event trick, which is already done for the other event handlers

Also refactored from pointer to touch events because (at least on non-iOS/on Chrome DevTools), pointermove stops firing once scroll starts, while touchmove always fires which ensures the popover always dismisses while scrolling away

Note: #2978 refactors away the timeout for the handleCaptureInside logic - I will rebase one of the PRs depending on which is merged first

@atomiks atomiks added type: bug It doesn't behave as expected. component: popover Changes related to the popover component. labels Oct 18, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 18, 2025

vite-css-base-ui-example

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

commit: 6a3846b

@netlify
Copy link

netlify bot commented Oct 18, 2025

Deploy Preview for base-ui ready!

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

@mui-bot
Copy link

mui-bot commented Oct 18, 2025

Bundle size report

Bundle Parsed size Gzip size
@base-ui-components/react 🔺+405B(+0.11%) 🔺+75B(+0.06%)

Details of bundle changes

@atomiks atomiks force-pushed the fix/pointer-move-children branch from 1e49be7 to f45a406 Compare October 18, 2025 11:57
@atomiks atomiks marked this pull request as ready for review October 18, 2025 12:29
@atomiks atomiks force-pushed the fix/pointer-move-children branch from 23548eb to a7806f2 Compare October 18, 2025 12:37
@atomiks atomiks force-pushed the fix/pointer-move-children branch from a7806f2 to 039fb7e Compare October 18, 2025 12:39
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Oct 21, 2025
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Oct 22, 2025
Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Csb with the fix: https://codesandbox.io/p/devbox/brave-butterfly-rm8zjs?workspaceId=ws_HE9JRzFW36Y2kpBoSwdvZ5

Can you elaborate why we are removing the way to customize the capture of the keyboard event using escape? What's the correlation to the bug?

/**
* Determines whether to use capture phase event listeners.
*/
capture?: boolean | { escapeKey?: boolean; outsidePress?: boolean };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we still need this? Why was it removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it's an option from Floating UI config, but we don't use it anywhere in our components, so it can be removed.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Oct 26, 2025
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Oct 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Modal inside Popover is closed unexpectedly on mobile when swiping

3 participants