Skip to content

[select] Add finalFocus prop#3785

Merged
atomiks merged 1 commit into
mui:masterfrom
markocupic024:final-focus-prop-select
Jan 21, 2026
Merged

[select] Add finalFocus prop#3785
atomiks merged 1 commit into
mui:masterfrom
markocupic024:final-focus-prop-select

Conversation

@markocupic024

@markocupic024 markocupic024 commented Jan 18, 2026

Copy link
Copy Markdown
Contributor

Closes #3752

Followed existing patterns in code

@pkg-pr-new

pkg-pr-new Bot commented Jan 18, 2026

Copy link
Copy Markdown
  • vite-css-base-ui-example

    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/react@3785
    
    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/utils@3785
    

commit: 16118d0

@mui-bot

mui-bot commented Jan 18, 2026

Copy link
Copy Markdown

Bundle size report

Bundle Parsed size Gzip size
@base-ui/react 🔺+31B(+0.01%) 🔺+4B(0.00%)

Details of bundle changes


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

@greptile-apps

greptile-apps Bot commented Jan 18, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds the finalFocus prop to the Select.Popup component, bringing feature parity with Menu and Dialog components. The implementation follows the established pattern used in other popup components in the codebase.

Changes:

  • Added finalFocus prop to SelectPopup component that accepts boolean, ref, or function to control focus behavior when the popup closes
  • Passed the prop to FloatingFocusManager as returnFocus parameter
  • Added comprehensive test coverage for all prop variations (boolean, ref, function return types)
  • Updated generated documentation and component reference

Implementation quality:

  • Correctly follows existing patterns from MenuPopup.tsx (packages/react/src/menu/popup/MenuPopup.tsx:136)
  • Type definition matches other components using InteractionType from useEnhancedClickHandler
  • Test coverage is thorough and mirrors test patterns in DialogPopup.test.tsx

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The implementation follows well-established patterns from existing components (Menu and Dialog), includes comprehensive test coverage for all prop variations, and correctly integrates with the FloatingFocusManager. The changes are minimal, focused, and documentation is properly updated.
  • No files require special attention

Important Files Changed

Filename Overview
packages/react/src/select/popup/SelectPopup.tsx Added finalFocus prop following existing patterns from Menu and Dialog components
packages/react/src/select/popup/SelectPopup.test.tsx Comprehensive test coverage for all finalFocus prop variations
docs/reference/generated/select-popup.json Generated documentation correctly includes finalFocus prop with proper type information
docs/src/app/(docs)/react/components/page.mdx Documentation index updated to list finalFocus in SelectPopup props

@netlify

netlify Bot commented Jan 18, 2026

Copy link
Copy Markdown

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 16118d0
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/696d5a6984c1e40008548a48
😎 Deploy Preview https://deploy-preview-3785--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.

@mj12albert mj12albert added the component: select Changes related to the select component. label Jan 19, 2026

@atomiks atomiks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

@atomiks atomiks merged commit ba4349e into mui:master Jan 21, 2026
23 of 24 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[select] Missing finalFocus prop

4 participants