-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
when applying md-button on a button, (click) is not triggered #3478
Comments
Hello everyone. It's been 3 weeks since the issue was opened, and there is no news. Thanks guys. 🐙 |
I haven't had the chance to look at it yet. I'll check it out tonight. |
@maxime1992 I wasn't able to reproduce it locally with a similar HTML structure. Can you try to do another Plunkr? Now our template uses Angular 4 as well. |
@crisbeto couldn't repro in the Plunkr 😞 If you want to try in our repo :
Open your browser at : http://localhost:4200/workspaces/idWks0/petals/service-units/idSu0 Open the file Change those lines :
By :
(notice the The click works and you'll see the UI updated |
Your issue comes from the fact that the button actually gets re-rendered on
What happens in this case is that the button ripple effect triggers change detection on the |
It sounds like I could have post my question on StackOverflow now but thank you for your time @crisbeto, I really appreciate the (detailed) explanation ! 😃 🍻 |
@crisbeto there is something I didn't understand in your explanation/workaroud. What I understood is: My question is: is it needed to return the same array with Thank you for your time :) |
The |
@crisbeto that's the thing, if we put a But, could you really confirm something to me: do we agree that once #3066 is applied, the original problem should be solved EVEN IF |
Yes, I believe that it should be fixed once #3066 is in. You can try out the latest build with this: npm install https://github.com/angular/material2-builds.git |
ok, thanks for your help :) |
For the record (if someone comes around here with the same problem), another solution is to exploit |
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. |
Bug, 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 :
the
changeState
function is called.But if I add
md-button
ormd-raised-button
on the button, the design is the one expected but clicking on the button never triggerschangeState
function.What are the steps to reproduce?
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 running4.0.0-rc.2
.Which versions of Angular, Material, OS, browsers are affected?
4.0.0-rc.2
(didn't try under that version)The text was updated successfully, but these errors were encountered: