-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
bug(MatButtonModule): Disabled mat-button with routerLink still works #19428
Comments
I was able to reproduce this. Usually anchor elements cannot be disabled (natively), but our One could argue this is working as expected, but then we shouldn't support the Related post: https://css-tricks.com/how-to-disable-links/ |
I hope the following info could help fixing the issue:
However, in this case the attribute is
Could |
Just to ensure this gets some minor activity and does not get closed I confirm I have stumbled on this today. Since For the time being, I will be filtering the (click) event myself but I hope this gets some attention. |
I also reproduce this issue. It seems like this is a side effect of c2abcad, it is supposed to avoid "actually" disabling the button so it may have a tooltip, but I guess it also lets it keep the href. Here is a workaround with a global style that works for my case (it disables any tooltip too): .mat-button-disabled {
pointer-events: none;
} |
This has been reported before: #12920 |
+1 on this one, if the attribute is supported then it should be working as expected |
Cannot reproduce. I believe this has been fixed. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Reproduction
The issue is reproduced on StackBlitz: https://stackblitz.com/edit/inactive-links-problem
Steps to reproduce:
<a mat-button routerLink="/foo" [disabled]="true">Foo</a>
Expected Behavior
The button is visually disabled and clicking it does not activate the link.
Actual Behavior
The button is indeed visually disabled, but the link still works.
Environment
The text was updated successfully, but these errors were encountered: