[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".
There was a problem hiding this comment.
I worry this would be a breaking change for developers who are using inputClasses.adornedStart etc in runtime JS and they are expecting that it is targeting .MuiInputBase-adornedStart but now with this change it will target .MuiInput-adornedStart. I agree that the types are not available on Input, but the types should match the runtime logic. But with the addition of runtime JS logic for classes, I think we are cluttering the DOM unnecessarily by having both .MuiInput-* and .MuiInputBase-* classes on the same element.
I know this is inconsistent between all three variants (filled, outlined and standard) but for the sake of not breaking anything I feel we should not do this change until the next major. However, I will keep the issue open.
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