Skip to content

[input] Add missing InputBase class keys - #48940

Open
tianrking wants to merge 2 commits into
mui:masterfrom
tianrking:codex/input-base-class-types
Open

[input] Add missing InputBase class keys#48940
tianrking wants to merge 2 commits into
mui:masterfrom
tianrking:codex/input-base-class-types

Conversation

@tianrking

Copy link
Copy Markdown

Fixes #20706.

inputClasses already exposes the class keys inherited from InputBase at runtime, but InputClasses omitted adornedStart, adornedEnd, hiddenLabel, and readOnly. As a result, TypeScript rejected these valid keys when they were passed to the Input component's classes prop.

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 typescript
  • pnpm test:node Input (214 passed, 39 skipped)
  • pnpm prettier
  • pnpm eslint
  • pnpm proptypes
  • pnpm docs:api

@code-infra-dashboard

code-infra-dashboard Bot commented Aug 8, 2026

Copy link
Copy Markdown

Deploy preview

https://deploy-preview-48940--material-ui.netlify.app/
QR code for https://deploy-preview-48940--material-ui.netlify.app/

Bundle size

Bundle Parsed size Gzip size
@mui/material 🔺+211B(+0.04%) 🔺+25B(+0.02%)
@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


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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread docs/pages/material-ui/api/input.json
@ZeeshanTamboli ZeeshanTamboli changed the title [material-ui][Input] Add missing InputBase class keys [input] Add missing InputBase class keys Aug 11, 2026
@ZeeshanTamboli ZeeshanTamboli added the scope: input Changes related to the input. label Aug 11, 2026

@ZeeshanTamboli ZeeshanTamboli 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.

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.

@ZeeshanTamboli ZeeshanTamboli added breaking change Introduces changes that are not backward compatible. type: bug It doesn't behave as expected. typescript labels Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Introduces changes that are not backward compatible. scope: input Changes related to the input. type: bug It doesn't behave as expected. typescript

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TextField] Missing pseudo-classes generates error when overriding <Input>

2 participants