[material-ui][Input] Add missing InputBase class keys - #48940
Conversation
Deploy previewBundle size
Check out the code infra dashboard for more information about this PR. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 21aaadb301
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "classes": [ | ||
| { | ||
| "key": "adornedEnd", | ||
| "className": "MuiInput-adornedEnd", |
There was a problem hiding this comment.
Emit the documented Input state classes
When endAdornment, startAdornment, or hiddenLabel is active, Input.useUtilityClasses does not compose these state slots, and inputClasses inherits their values from inputBaseClasses; the rendered classes are therefore MuiInputBase-adornedEnd, MuiInputBase-adornedStart, and MuiInputBase-hiddenLabel. The newly documented .MuiInput-* selectors never match, so users following the CSS API cannot style these states. Either compose the corresponding MuiInput classes at runtime or document the actual inherited class names.
Useful? React with 👍 / 👎.
Fixes #20706.
inputClassesalready exposes the class keys inherited fromInputBaseat runtime, butInputClassesomittedadornedStart,adornedEnd,hiddenLabel, andreadOnly. As a result, TypeScript rejected these valid keys when they were passed to theInputcomponent'sclassesprop.This change aligns the public type and generated API documentation with the existing runtime class map, and adds focused compile-time coverage for all four keys.
Tests:
pnpm -F @mui/material typescriptpnpm test:node Input(214 passed, 39 skipped)pnpm prettierpnpm eslintpnpm proptypespnpm docs:api