-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Description
Bug, feature request, or proposal:
Bug
What is the expected behavior?
Given this template: <a mat-button disabled (click)="someHandler()">Foo</a>
the someHandler() method should not be called when the button is clicked.
What is the current behavior?
The someHandler() method is called when the button is clicked.
What are the steps to reproduce?
https://stackblitz.com/edit/angular-ucd9ew
I've included samples with each combination of button/anchor tag and enabled/disabled state.
Clicking the button in each will increment a counter if the handler is called. When clicked, the disabled anchor tag based button in the lower right triggers its handler erroneously.
What is the use-case or motivation for changing an existing behavior?
Disabled buttons shouldn't do anything, even when they're made from anchor tags.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Only tested with Angular 6.1.6, Material 6.4.7, and TypeScript 2.7.2.
Tested in Chrome for MacOS Version 68.0.3440.106 (Official Build) (64-bit) and in Safari Version 11.1.1 (13605.2.8).
Is there anything else we should know?
Not that I am aware of.