Skip to content

[inputs] Fix autofocus in SSR environment#48290

Merged
mj12albert merged 5 commits into
mui:masterfrom
mj12albert:fix-input-prehydration-autofocus
Apr 16, 2026
Merged

[inputs] Fix autofocus in SSR environment#48290
mj12albert merged 5 commits into
mui:masterfrom
mj12albert:fix-input-prehydration-autofocus

Conversation

@mj12albert
Copy link
Copy Markdown
Member

@mj12albert mj12albert commented Apr 15, 2026

Preview: https://deploy-preview-48290--material-ui.netlify.app/experiments/autofocus/ (couldn't get this to work in CSB)

Fixes #40397

Based on mui/base-ui#3871

@mj12albert mj12albert added type: bug It doesn't behave as expected. scope: input Changes related to the input. labels Apr 15, 2026
@code-infra-dashboard
Copy link
Copy Markdown

code-infra-dashboard Bot commented Apr 15, 2026

Bundle size

Bundle Parsed size Gzip size
@mui/material 🔺+173B(+0.03%) 🔺+64B(+0.04%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/private-theming 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes

Deploy preview

https://deploy-preview-48290--material-ui.netlify.app/


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

@mj12albert mj12albert force-pushed the fix-input-prehydration-autofocus branch 3 times, most recently from ac2af6e to f3db9b6 Compare April 15, 2026 15:14
@mj12albert mj12albert marked this pull request as ready for review April 15, 2026 15:27
Comment thread packages/mui-material/src/InputBase/InputBase.js Outdated
Comment thread packages/mui-material/src/InputBase/InputBase.test.js Outdated
Comment thread packages/mui-material/src/InputBase/InputBase.test.js
Comment thread packages/mui-material/src/InputBase/InputBase.test.js Outdated
@mj12albert mj12albert force-pushed the fix-input-prehydration-autofocus branch from f101900 to 7c98249 Compare April 16, 2026 12:18
Copy link
Copy Markdown
Member

@ZeeshanTamboli ZeeshanTamboli left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@mj12albert mj12albert force-pushed the fix-input-prehydration-autofocus branch from 7c98249 to 60ad902 Compare April 16, 2026 17:02
@mj12albert mj12albert enabled auto-merge (squash) April 16, 2026 17:20
@mj12albert mj12albert added v7.x needs cherry-pick The PR should be cherry-picked to master after merge. labels Apr 16, 2026
@mj12albert mj12albert merged commit f417078 into mui:master Apr 16, 2026
25 checks passed
@github-actions
Copy link
Copy Markdown

Cherry-pick PRs will be created targeting branches: v7.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs cherry-pick The PR should be cherry-picked to master after merge. scope: input Changes related to the input. type: bug It doesn't behave as expected. v7.x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Text Field] autoFocus prop not working consistently in Next.js

2 participants