Skip to content
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

(click) event generates twice on md-slide-toggle and md-chekbox #671

Closed
geelus opened this issue Jun 12, 2016 · 5 comments · Fixed by #672
Closed

(click) event generates twice on md-slide-toggle and md-chekbox #671

geelus opened this issue Jun 12, 2016 · 5 comments · Fixed by #672

Comments

@geelus
Copy link

geelus commented Jun 12, 2016

Bug, feature request, or proposal:

Bug

What is the expected behavior?

(click) to generate a single event

What is the current behavior?

it generates double event

What are the steps to reproduce?

on the md-checkbox and md-slide-toggle create a (click) event binding and you will see it runs the function twice.
Providing a Plunker (or similar) is the best way to get the team to see your issue.
Plunker template: http://plnkr.co/edit/FxHKvcNJe2Zq5Mq5Imni?p=info

What is the use-case or motivation for changing an existing behavior?

Which versions of Angular, Material, OS, browsers are affected?

Is there anything else we should know?

This issue might exist on other components but I haven't tested them.

devversion added a commit to devversion/material2 that referenced this issue Jun 12, 2016
* Currently the (click) event gets called twice.
  This is caused by the bubbling of the (click) event on the input.

Fixes angular#671.
@devversion
Copy link
Member

The issue with the Checkbox is already in progress.

@rushi216
Copy link

Even change event fires twice in md-slide-toggle

http://plnkr.co/edit/JPZHqfnMbOvsKWGRL2dM?p=preview

@devversion
Copy link
Member

@rushi216 This is already fixed in master.

@jelbourn
Copy link
Member

Dupe of #651

jelbourn pushed a commit that referenced this issue Jun 15, 2016
* fix(slide-toggle and checkbox): visual hidden input should not bubble click

* Currently the (click) event gets called twice.
  This is caused by the bubbling of the (click) event on the input.

Fixes #671.

* update(): move input click into component source

* Moved input click event into component source file.
* Added comment for the issue cause.

* fix(checkbox): do not trigger the click event twice
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants