Skip to content

[select] Ignore unrelated mouseup after a fast trigger click - #6048

Merged
atomiks merged 1 commit into
mui:masterfrom
atomiks:select-stale-mouseup-listener
Nov 10, 2026
Merged

atomiks merged 1 commit into
mui:masterfrom
atomiks:select-stale-mouseup-listener

Conversation

@atomiks

@atomiks atomiks commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Fixes #6042

Select.Trigger attached its document mouseup listener in a 0 ms timeout. When the opening press was released before that timeout ran (a trackpad tap or a very fast click), the listener missed it and stayed registered, so the next unrelated release, such as dragging out of the popup, closed the Select.

This PR adds the listener synchronously in onMouseDown, like MenuTrigger and ComboboxTrigger already do. The timeout's "Firefox can fire this upon mousedown" comment no longer applies: in Firefox 158, opening, press-drag-to-select, drag-off-to-cancel and touch taps all behave the same with and without item alignment.

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

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

Copy link
Copy Markdown

commit: 3401369

@code-infra-dashboard

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

Copy link
Copy Markdown

Bundle size

Bundle Parsed size Gzip size
@base-ui/react ▼-38B(-0.01%) ▼-11B(-0.01%)

Details of bundle changes

Performance

No regressions in 36 benchmarks · ran 3m 59s · details


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

@netlify

netlify Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 3401369
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6af2a3dcb0f4cfc5544572e7
😎 Deploy Preview https://deploy-preview-6048--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 22, 2026 09:36
@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Oct 28, 2026
@atomiks
atomiks force-pushed the select-stale-mouseup-listener branch from a1cadd7 to 3401369 Compare November 10, 2026 04:55
@github-actions github-actions Bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Nov 10, 2026
@atomiks
atomiks enabled auto-merge (squash) November 10, 2026 04:56
@atomiks
atomiks merged commit a2c7b31 into mui:master Nov 10, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[select] A fast click on the trigger leaves a stale mouseup listener that closes the Select later

1 participant