Skip to content

[select] Fix touch reopen highlight - #4356

Merged
atomiks merged 2 commits into
mui:masterfrom
atomiks:codex/select-touch-highlight
Mar 17, 2026
Merged

atomiks merged 2 commits into
mui:masterfrom
atomiks:codex/select-touch-highlight

Conversation

@atomiks

@atomiks atomiks commented Mar 16, 2026

Copy link
Copy Markdown
Contributor

Summary

This fixes a touch-specific Select regression where reopening after a selection could briefly restore the selected item highlight and then immediately clear it again.

Changes

  • Ignore touch-originated mouseleave highlight clearing in Select.Item, including the queued timeout callback.
  • Add a Chromium regression test that covers touch selection, a synthetic mouseleave, and reopening the popup.

@atomiks atomiks added component: select Changes related to the select component. type: bug It doesn't behave as expected. mobile Targets mobile platform. labels Mar 16, 2026
@atomiks

atomiks commented Mar 16, 2026

Copy link
Copy Markdown
Contributor Author

Codex Review

Overview

This patch prevents a touch-driven synthetic mouseleave from clearing Select's restored highlight when the popup reopens. It also adds a Chromium regression test for the touch selection, mouseleave, and reopen sequence.

Findings (None)

No blocking issues found in this patch.

Confidence: 4/5

High confidence based on the small branch diff, a full pass over the changed code paths, and targeted Chromium and JSDOM verification.

Notes

  • Verified with pnpm test:chromium SelectRoot --no-watch -t "keeps touch interaction type when reopening quickly after close".
  • Verified with pnpm test:chromium SelectRoot --no-watch -t "keeps the selected item highlighted when reopening after a touch-driven mouseleave".
  • Verified with pnpm test:jsdom SelectItem --no-watch.

@pkg-pr-new

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

commit: 4fe6b2b

@mui-bot

mui-bot commented Mar 16, 2026 •

Copy link
Copy Markdown

Bundle size report

Bundle Parsed size Gzip size
@base-ui/react 🔺+42B(+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 16, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 4fe6b2b
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/69b9008ad62d6b000877a6a5
😎 Deploy Preview https://deploy-preview-4356--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 force-pushed the codex/select-touch-highlight branch from 7348ca4 to 4fe6b2b Compare March 17, 2026 07:19
@atomiks
atomiks marked this pull request as ready for review March 17, 2026 07:38
@atomiks
atomiks merged commit 07600be into mui:master Mar 17, 2026
7 checks passed
@atomiks
atomiks deleted the codex/select-touch-highlight branch March 17, 2026 07:38
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. 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.

3 participants