Skip to content

[select] Reset preserved touch modality after close transition#4367

Merged
atomiks merged 10 commits intomui:masterfrom
atomiks:codex/select-touch-open-method-reset
Mar 18, 2026
Merged

[select] Reset preserved touch modality after close transition#4367
atomiks merged 10 commits intomui:masterfrom
atomiks:codex/select-touch-open-method-reset

Conversation

@atomiks
Copy link
Contributor

@atomiks atomiks commented Mar 18, 2026

Summary

Fixes a Select touch regression where reopening after the close transition can reuse the preserved touch interaction type and reopen from the wrong positioning mode.

This regressed in 4fd87cad4 ([select] Preserve touch exit animations). That commit landed after v1.3.0, so this is a post-1.3.0 regression. I'm marking this PR internal and type: regression; it should not need release notes.

Changes

  • Stop preserving the previous touch openMethod once the close transition has fully finished and the popup is no longer mounted.
  • Add a Chromium regression test that covers touch open, close, and reopen near the bottom of the viewport.

@atomiks atomiks added component: select Changes related to the select component. type: regression A bug, but worse, it used to behave as expected. internal Behind-the-scenes enhancement. Formerly called “core”. labels Mar 18, 2026
@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 18, 2026

commit: 8f674f3

@mui-bot
Copy link

mui-bot commented Mar 18, 2026

Bundle size report

Bundle Parsed size Gzip size
@base-ui/react 🔺+74B(+0.02%) 🔺+22B(+0.02%)

Details of bundle changes


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

@netlify
Copy link

netlify bot commented Mar 18, 2026

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 8f674f3
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/69babe4086328a00080b2851
😎 Deploy Preview https://deploy-preview-4367--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
Copy link
Contributor Author

atomiks commented Mar 18, 2026

Codex Review

Overview

This branch fixes the Select touch reopen bug by keeping a hidden keep-mounted popup from recalculating into the wrong side and tiny height while it is fully closed. It also adds a Chromium regression that matches the real long-list repro near the bottom of the viewport.

Findings (None)

No blocking issues found in this patch.

Confidence: 4/5

High confidence based on a full-branch pass over the master...HEAD diff, direct review of the shared positioning changes, and targeted verification in both Select and NavigationMenu paths. The main residual risk is that this touches shared keep-mounted positioning behavior, but the diff is small and the follow-up checks cover the most likely regression path.

Notes

  • The branch diff against master is still narrow: packages/react/src/utils/useAnchorPositioning.ts passes open: keepMounted ? mounted : undefined to useFloating, and the size() middleware now uses a simple mountedRef.current guard without an explicit dep array so closed popups stop overwriting their size variables while hidden.
  • packages/react/src/select/root/SelectRoot.test.tsx adds a stronger browser regression with the measured 100px viewport-gap setup, touch dismiss, and reopen assertions against the long-list path that was actually failing.
  • I reviewed the explicit second-pass categories for this final diff: React/rendering correctness, accessibility/semantics, API/state design, maintainability/simplification, performance, and test quality. I did not find additional branch-relevant issues beyond the bug this patch fixes.
  • Verified with pnpm test:chromium SelectRoot --no-watch -t "recomputes positioning before the popup becomes visible again after touch dismiss", pnpm test:jsdom SelectRoot --no-watch, pnpm exec eslint packages/react/src/utils/useAnchorPositioning.ts packages/react/src/select/root/SelectRoot.test.tsx, and pnpm exec prettier --check packages/react/src/utils/useAnchorPositioning.ts packages/react/src/select/root/SelectRoot.test.tsx.

@atomiks atomiks force-pushed the codex/select-touch-open-method-reset branch from 0e01729 to a2203fb Compare March 18, 2026 13:53
@atomiks atomiks marked this pull request as ready for review March 18, 2026 15:05
@atomiks atomiks merged commit a68d387 into mui:master Mar 18, 2026
23 checks passed
@atomiks atomiks deleted the codex/select-touch-open-method-reset branch March 18, 2026 15:06
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. internal Behind-the-scenes enhancement. Formerly called “core”. type: regression A bug, but worse, it used to behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants