Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[material-ui][OutlinedInput] Theme options ownerState does not contain correct values #42333

Open
Crownie88 opened this issue May 22, 2024 · 1 comment
Assignees
Labels
component: input This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material

Comments

@Crownie88
Copy link

Crownie88 commented May 22, 2024

Steps to reproduce

Link to live example: (required)

Steps:
1.
2.
3.

Current behavior

I have an TextField with required set to true.
When styling the MuiOutlinedInput I want conditional styling when the element is required but the ownerstate.required is not set to true.

However, when im styling MuiFormControl .MuiInputBase-root fieldset:first-of-type the ownerstate does contain the right information.

Expected behavior

I expect the MuiOutlinedInput to contain the correct ownerstates since this is the control where i actually set the "required" attribute.

Context

Conditional styling in my theme options

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: required ownerstate themeoptions

@Crownie88 Crownie88 added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label May 22, 2024
@zannager zannager added package: system Specific to @mui/system customization: theme Centered around the theming features labels May 22, 2024
@danilo-leal danilo-leal changed the title ThemeOptions Ownerstate for MuiOutlinedInput does not contain correct values [material-ui][OutlinedInput] Theme options ownerState does not contain correct values May 28, 2024
@danilo-leal danilo-leal added package: material-ui Specific to @mui/material component: input This is the name of the generic UI component, not the React module! and removed package: system Specific to @mui/system customization: theme Centered around the theming features labels May 28, 2024
@danilo-leal
Copy link
Contributor

Hey, thanks for opening the issue! Could you provide a minimal reproduction? It helps us troubleshoot. A live example would be perfect. This StackBlitz sandbox template may be a good starting point.

@danilo-leal danilo-leal removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: input This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material
Projects
None yet
Development

No branches or pull requests

4 participants