question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Button] Disabled classes not added to the button

See original GitHub issue
  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

“my-disabled” class not added to the Button.

Steps to Reproduce 🕹

https://codesandbox.io/s/material-ui-issue-forked-12phu?file=/src/Demo.js

<Button disabled classes={{ disabled: "my-disabled" }}>A button</Button>

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
oliviertassinaricommented, May 18, 2021

@Boimb Either way is probably OK.

1reaction
Boimbcommented, May 17, 2021

@oliviertassinari , I know this issue is closed, but felt not to open a new one for my question: How can I override .Mui-contained.Mui-disabled? As far as I tried, disabled in classes does not take precedence over the “composed class”. I feel there must be a better way than adding !important to my property 😃 Thx.

[EDIT] Found the trick:

const useStyles = makeStyles(theme => ({
  contained: {
    '&$disabled': {
      backgroundColor: 'red',
    },
  },
  disabled: {}
}))

The important thing is to add the empty property disabled (can be not empty too) [/EDIT]

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Button] Disabled classes not added to the button · Issue #25011
The issue is present in the latest release. I have searched the issues of this repository and believe that this is not a...
Read more >
Disabled button styling not applied [duplicate] - Stack Overflow
I am trying to add disabled styling to a button component using SCSS. I have a button that have multiple classes <button className="button...
Read more >
How can adding the 'disabled' class actually disable the button?
The proper way to disable a button in jQuery is, according to what I can find on google, .prop("disabled", true) , not just...
Read more >
HTML DOM Button disabled Property - W3Schools
The disabled property sets or returns whether a button is disabled, or not. A disabled element is unusable and un-clickable. Disabled elements are...
Read more >
How to Set the disabled state in Angular Button component
Button component can be enabled/disabled by giving disabled property. To disable Button component, the disabled property can be set as true .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found