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

MuiFormLabel.focused does not seem to take effect. #19418

Closed
aprilmintacpineda opened this issue Jan 27, 2020 · 2 comments
Closed

MuiFormLabel.focused does not seem to take effect. #19418

aprilmintacpineda opened this issue Jan 27, 2020 · 2 comments
Labels
support: Stack Overflow Please ask the community on Stack Overflow

Comments

@aprilmintacpineda
Copy link

Problem:

I need to change the behavior of the Radio to not change the color of the label when you click on one of the item.

Example:

Before choosing (or clicking) one of the items:

image

After clicking Male on the left side Radio group, the label changes color

image

The docs did not mention any of this, but I saw that the label is actually a MuiFormLabel-root that means it is using the FormLabel component.

I tried doing:

createMuiTheme({
  overrides: {
    MuiFormLabel: {
      focused: {
        color: '#000 !important'
      }
    }
  }
});

Which according to the docs will allow me to change the .Mui-focused, but it did not work. I tried:

createMuiTheme({
  overrides: {
    MuiFormLabel: {
      root: {
        color: 'blue'
      }
    }
  }
});

And I saw it took effect, which means I'm pretty much on the correct path but can't find the right trigger.

I've seen #11244 and tried out different approach but non of which worked. Is this even possibru?

@joshwooding
Copy link
Member

joshwooding commented Jan 27, 2020

Hmm… I can’t trigger focus on a mobile. This should work:

MuiFormLabel: {
  root: {
    &$focused”: {
      color: “red”,
    }
  }
}

@joshwooding joshwooding added the support: Stack Overflow Please ask the community on Stack Overflow label Jan 27, 2020
@support
Copy link

support bot commented Jan 27, 2020

👋 Thanks for using Material-UI!

We use GitHub issues exclusively as a bug and feature requests tracker, however,
this issue appears to be a support request.

For support, please check out https://material-ui.com/getting-started/support/. Thanks!

If you have a question on StackOverflow, you are welcome to link to it here, it might help others.
If your issue is subsequently confirmed as a bug, and the report follows the issue template, it can be reopened.

@support support bot closed this as completed Jan 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support: Stack Overflow Please ask the community on Stack Overflow
Projects
None yet
Development

No branches or pull requests

2 participants