Button - kind and disabled button doesn't apply when hover and plain
See original GitHub issueExpected Behavior
disabled
styles should apply when hoverindicator
or plain
is set on a grommet button.
Actual Behavior
No disabled styles applied.
URL, screen shot, or Codepen exhibiting the issue
Use this code when using the kind button, and see how disabled styles don’t apply.
<Button
label="Disabled"
disabled
hoverIndicator
plain
icon={<FormNext />}
/>
Related to https://github.com/grommet/grommet-theme-hpe/pull/110
Steps to Reproduce
Your Environment
- Grommet version: 2.15.0
- Browser Name and version:
- Operating System and version (desktop or mobile):
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
How can I make a CSS Hover not work if a button is disabled?
Use the CSS :Not attribute selector to only target elements that don't have the disabled attribute.
Read more >Making Disabled Buttons More Inclusive - CSS-Tricks
If you use a mouse, and hover over the submit button, a tooltip is shown explaining why the button is disabled. That's great!...
Read more >HTML button tag - W3Schools
Attributes ; disabled, disabled, Specifies that a button should be disabled ; form, form_id, Specifies which form the button belongs to ; formaction,...
Read more >Element: <oj-button> - Oracle
JET Button. Description: Themeable, WAI-ARIA-compliant push buttons, with appropriate styles for hover, active, checked, and disabled.
Read more >Onhover on CSS doesn't work on disabled elements
you have used text as a class in above div but when you apply hover over disabled button you have applied text as...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think we have implemented all possible action items for this issue as linked to the PRs above. With button kind, users can define disabled text color, border color, etc but plain will only look at the disabled opacity value
props.theme.button.disabled.opacity
. The issue we experienced with the HPE theme, is that the opacity is set to 1.0 so you don’t see any drop in opacity on disabled + kind + plain Button. But, if any other theme relied on the grommet default opacity (0.3) or defined their own (as long as it’s not 1.0) then the disabled opacity would give a visual effect of “disabled”. In the case of HPE theme users, it will be recommended not to useplain
buttons.@leonardodino thanks buddy, from what I’ve seen, Button + plain + disabled + kind (kind is when button.default is defined on the theme), the plain button doesn’t get the text opacity or the
text-weak
property, so the Buttondisabled
text isn’t reflecting the disabled property well.