Skip to content

[docs] Clarify that fieldRef.current.focusField() is the canonical way to focus a field#22937

Merged
michelengelen merged 4 commits into
mui:masterfrom
michelengelen:recipe/pickers/22592
Jun 30, 2026
Merged

[docs] Clarify that fieldRef.current.focusField() is the canonical way to focus a field#22937
michelengelen merged 4 commits into
mui:masterfrom
michelengelen:recipe/pickers/22592

Conversation

@michelengelen

Copy link
Copy Markdown
Member

Follows up on #22592 (a v10 RFC for hidden-input focus delegation), which calls out that the docs should recommend fieldRef.current.focusField() over inputRef.current.focus() ahead of that breaking change. Adds a warning callout to the Fields docs, next to the existing imperative API demo, explaining why focusField() is the API to use.

Fixes #22592

@michelengelen michelengelen self-assigned this Jun 25, 2026
@michelengelen michelengelen added docs Improvements or additions to the documentation. scope: pickers Changes related to the date/time pickers. type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. labels Jun 25, 2026
@code-infra-dashboard

code-infra-dashboard Bot commented Jun 25, 2026

Copy link
Copy Markdown

Deploy preview

Bundle size

Bundle Parsed size Gzip size
@mui/x-data-grid 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-pro 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-premium 0B(0.00%) 0B(0.00%)
@mui/x-charts 0B(0.00%) 0B(0.00%)
@mui/x-charts-pro 0B(0.00%) 0B(0.00%)
@mui/x-charts-premium 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers-pro 0B(0.00%) 0B(0.00%)
@mui/x-tree-view 0B(0.00%) 0B(0.00%)
@mui/x-tree-view-pro 0B(0.00%) 0B(0.00%)
@mui/x-license 0B(0.00%) 0B(0.00%)

Details of bundle changes


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

@LukasTy LukasTy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice direction. 👍

But maybe we should remove leftover usages in docs of inputRef.current?.focus() to better reflect this direction?

Comment thread docs/data/date-pickers/fields/fields.md Outdated
@michelengelen
michelengelen requested a review from LukasTy June 29, 2026 06:59

@LukasTy LukasTy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. 👍
Very nice improvement. 💯

@michelengelen
michelengelen merged commit 70baced into mui:master Jun 30, 2026
21 checks passed
@michelengelen
michelengelen deleted the recipe/pickers/22592 branch June 30, 2026 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to the documentation. scope: pickers Changes related to the date/time pickers. type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[fields] Re-evaluate hidden-input focus delegation (v10 breaking change)

2 participants