when applying md-button on a button, (click) is not triggered
See original GitHub issueBug, feature request, or proposal:
Bug
What is the expected behavior?
Even if a button has the md-button
attribute we should be able to bind the click event.
What is the current behavior?
Checkout this line of HTML :
<button
*ngFor="let possibleState of getPossibleStateActions(serviceUnit.state)"
(click)="changeState(possibleState.newStateAfterAction)"
[disabled]="serviceUnit.isUpdatingState"
>
{{ possibleState.actionName }}
</button>
the changeState
function is called.
But if I add md-button
or md-raised-button
on the button, the design is the one expected but clicking on the button never triggers changeState
function.
What are the steps to reproduce?
git clone https://gitlab.com/linagora/petals-cockpit.git
git checkout ab7f5d5816
cd frontend
yarn
ng serve
I did try to reproduce on Plunkr but I couldn’t.
I didn’t check the version on Plunkr but maybe Angular is running on 2.x
and my project is running 4.0.0-rc.2
.
Which versions of Angular, Material, OS, browsers are affected?
4.0.0-rc.2
(didn’t try under that version)
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:14 (5 by maintainers)
Top Results From Across the Web
Client Button Click event not triggered when clicking on button ...
I am using RadToolBar Button with FontAwesome icon and text. When I click on FontAwesome icon on button, it trigger the ...
Read more >Click() method not working and Console returns an error ...
Output: This error pops up when we click on button B. Example: This example resolves the above TypeError by accessing an individual element....
Read more >Element: click event - Web APIs | MDN
An element receives a click event when a pointing device button (such as a mouse's primary mouse button) is both pressed and released...
Read more >When a Click is Not Just a Click | CSS-Tricks
The click event is usually tied to a pointer device, typically the mouse, and yet here the Space or Enter key are triggering...
Read more >How To Trigger Button Click on Enter - W3Schools
Trigger a button click on keyboard "enter" with JavaScript. Trigger a Button Click on Enter. Press the "Enter" key inside the input field...
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 haven’t had the chance to look at it yet. I’ll check it out tonight.
Yes, I believe that it should be fixed once #3066 is in. You can try out the latest build with this: