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.

bug(button): Disable button within Directive when using prebuilt theme remains enabled

See original GitHub issue

Reproduction

Use StackBlitz to reproduce your issue: https://stackblitz.com/edit/angular10-ivy-mat?file=src/styles.css

Steps to reproduce:

  1. Run app
  2. Command A button remains enabled (even tho its disabled via directive ssvCommand) - every 2.5sec should cycle between enable/disable
  3. 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:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
crisbetocommented, Oct 26, 2020

It probably worked on 9.x, because we used to use the disabled attribute for styling. In 10.x we started using the mat-button-disabled class in order to support the case where a button appears disabled, but it’s still focusable.

0reactions
angular-automatic-lock-bot[bot]commented, Nov 26, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

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