bug(button): Disable button within Directive when using prebuilt theme remains enabled
See original GitHub issueReproduction
Use StackBlitz to reproduce your issue: https://stackblitz.com/edit/angular10-ivy-mat?file=src/styles.css
Steps to reproduce:
- Run app
- Command A button remains enabled (even tho its disabled via directive
ssvCommand
) - every 2.5sec should cycle between enable/disable - Comment out style import within
style.css
and it will as intended
Expected Behavior
When disabling a button within a Directive, when using material AND loaded a prebuilt theme, button should be styled as disabled.
Actual Behavior
Button is remained styled as enabled, even though its disabled
Environment
- Angular: 10.0.9
- CDK/Material: 10.2.5
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Windows
Note this on material 8/9 used to work, updated to 10.x and it didn’t
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Not able to disable buttons using custom angular directive
I'd be tempted to tap straight into the Observable and not use a directive. Component: buttonDisabled$: Observable<boolean>; ngOnInit() ...
Read more >Making Disabled Buttons More Inclusive - CSS-Tricks
Let's talk about disabled buttons. Specifically, let's get into why we use them and how we can do better than the traditional disabled...
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 >Working Disabling Mat Button By Directive - StackBlitz
Starter project for Angular apps that exports to the Angular CLI.
Read more >kendo contextmenu
Right-click on a cell in the example below to see the context menu. Buttons can be enabled or disabled, and The Kendo UI...
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
It probably worked on 9.x, because we used to use the
disabled
attribute for styling. In 10.x we started using themat-button-disabled
class in order to support the case where a button appears disabled, but it’s still focusable.This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.