Skip to content

[scroll area] Handle touch momentum scrolling for programmatic scroll check #2111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 20, 2025

Conversation

atomiks
Copy link
Contributor

@atomiks atomiks commented Jun 13, 2025

Since touch devices lack onWheel the scrolling state is unset while in momentum scroll phase: #1908

@atomiks atomiks added bug 🐛 Something isn't working component: scroll area labels Jun 13, 2025
Copy link

pkg-pr-new bot commented Jun 13, 2025

Open in StackBlitz

npm i https://pkg.pr.new/@base-ui-components/react@2111

commit: cafd369

@mui-bot
Copy link

mui-bot commented Jun 13, 2025

Bundle size report

Total Size Change: 🔺+55B(0.00%) - Total Gzip Change: 🔺+39B(+0.01%)
Files: 41 total (0 added, 0 removed, 2 changed)

Show details for 41 more bundles

@base-ui-components/reactparsed: 🔺+28B(+0.01%) gzip: 🔺+13B(+0.01%)
@base-ui-components/react/scroll-areaparsed: 🔺+27B(+0.17%) gzip: 🔺+26B(+0.47%)
@base-ui-components/react/accordionparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/alert-dialogparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/avatarparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/checkboxparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/checkbox-groupparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/collapsibleparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/context-menuparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/dialogparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/direction-providerparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/fieldparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/fieldsetparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/formparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/inputparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/menuparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/menubarparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/merge-propsparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/meterparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/navigation-menuparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/number-fieldparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/popoverparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/preview-cardparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/progressparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/radioparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/radio-groupparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/selectparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/separatorparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/sliderparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/switchparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/tabsparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/toastparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/toggleparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/toggle-groupparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/toolbarparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/tooltipparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/unstable-no-ssrparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/unstable-use-media-queryparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/use-renderparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/utilsparsed: 0B(0.00%) gzip: 0B(0.00%)
Base UI checkboxparsed: 0B(0.00%) gzip: 0B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against cafd369

Copy link

netlify bot commented Jun 13, 2025

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit cafd369
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/68515d5d1a046b0008a9d9ba
😎 Deploy Preview https://deploy-preview-2111--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 marked this pull request as ready for review June 13, 2025 10:07
@michaldudak
Copy link
Member

What problem does it solve? Momentum scrolling can last for much more than 100ms - is it enough to treat everything after this duration as programmatic scroll?

@atomiks
Copy link
Contributor Author

atomiks commented Jun 20, 2025

@michaldudak onScroll fires during momentum scrolling in quick succession so it works correctly until the end

@atomiks atomiks merged commit 2cc4e0c into mui:master Jun 20, 2025
22 checks passed
@atomiks atomiks deleted the fix/touch-scroll-area-interaction branch June 20, 2025 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working component: scroll area
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants