Skip to content

[drawer] Fix release velocity on 120 Hz input - #5845

Merged
atomiks merged 3 commits into
mui:masterfrom
atomiks:claude/base-ui-issue-investigation-091a18
Oct 5, 2026
Merged

atomiks merged 3 commits into
mui:masterfrom
atomiks:claude/base-ui-issue-investigation-091a18

Conversation

@atomiks

@atomiks atomiks commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #5837

useSwipeDismiss measured release velocity from the last two samples and floored the gap at 16 ms. At 120 Hz, consecutive touch moves are about 8 ms apart, so each half-size step was still divided by 16 ms and the velocity read about half the finger's speed. Snap point flicks that clear the 0.5 px/ms thresholds at 60 Hz snapped back at 120 Hz.

This PR lowers that minimum from 16 ms to 4 ms, under one frame at 240 Hz, so the latest moving pair is divided by its actual elapsed time. This also corrects mouse drags on high-refresh monitors, which read low the same way. The minimum still damps near-simultaneous samples, and the stationary-sample and 80 ms age rules from #5658 are unchanged.

Two tests encoded the halving and now expect the finger's speed: the trailing-sample test from #5658 (20 px every 8 ms, 1.25 → 2.5) and the first-move test (10 px over 8 ms, 0.625 → 1.25). New tests check that 60 Hz and 120 Hz input at the same speed release at the same velocity, and pin the 4 ms minimum.

@atomiks atomiks added component: drawer Changes related to the drawer component. type: bug It doesn't behave as expected. 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@5845
    
    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/utils@5845
    

commit: 8b3cb30

@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 ▼-1B(0.00%) 0B(0.00%)

Details of bundle changes

Performance

Total duration: 487.72 ms +68.04 ms(+16.2%) | Renders: 76 (+0) | Paint: 888.54 ms +103.46 ms(+13.2%)

Test Duration Renders
Slider mount (300 instances) 73.32 ms 🔺+26.68 ms(+57.2%) 2 (+0)
Tabs mount (200 instances) 91.22 ms 🔺+24.38 ms(+36.5%) 3 (+0)
Dialog mount (300 instances) 20.12 ms 🔺+8.88 ms(+79.1%) 1 (+0)
Popover mount (300 instances) 19.10 ms 🔺+5.30 ms(+38.4%) 1 (+0)

11 tests within noise — details

Metric alarms

Test Metric Change
Slider mount (300 instances) bench:paint 🔺 +46.80 ms
Tabs mount (200 instances) bench:paint 🔺 +32.79 ms
Dialog mount (300 instances) bench:paint 🔺 +17.11 ms
Popover mount (300 instances) bench:paint 🔺 +11.60 ms

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 8b3cb30
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6ac3134a4d10650008982bf5
😎 Deploy Preview https://deploy-preview-5845--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 03:35
@atomiks
atomiks force-pushed the claude/base-ui-issue-investigation-091a18 branch from 9bf9102 to 5eca842 Compare October 5, 2026 02:44
@atomiks
atomiks force-pushed the claude/base-ui-issue-investigation-091a18 branch from 5eca842 to 8b3cb30 Compare October 5, 2026 03:02
@atomiks
atomiks merged commit 6b5da6f 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.

[drawer] Release velocity reads about half the finger's speed on 120 Hz touch input

1 participant