Skip to content

[material-ui][Input] Add missing InputBase class keys - #48940

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

[material-ui][Input] Add missing InputBase class keys#48940
tianrking wants to merge 1 commit 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

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 0B(0.00%) 0B(0.00%)
@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".

"classes": [
{
"key": "adornedEnd",
"className": "MuiInput-adornedEnd",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant