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
alexeagle pushed a commit to alexeagle/material2 that referenced this issue Nov 6, 2024
* build: enable codelyzer and most default Angular CLI TSLint rules

- do some merging of tslint:recommended and our rules

* fix(a11y): fix theme picker keyboard access

enable Codelyzer a11y rules

Relates to angular#671

* fix(component-overview): header does not show up in headings list

Fixes angular#695

* fix(stack-blitz-button): no accessible label and description is not on correct element

Fixes angular#693

* fix(example-viewer): no accessible label on View source button

Fixes angular#693

* fix(component-sidenav): apply aria-current to selected nav items & improve contrast

- use Roboto font instead of system-ui for `docs-nav-content-btn`s
- use a different background color for selected route, in addition to different text color
- increase opacity of `docs-nav-content-btn`s to meet contrast guidelines
- switch to `mat-nav-list` to get the benefits of better contrast and hover/focus styles
  - plus slightly more padding for touch interfaces

Fixes angular#694. Relates to angular#671.

* fix: use header and main tags for more semantic HTML

- improves screen reader support
- footer tags were already properly used

Relates to angular#671.

* fix(component-nav): apply aria-label to navs

- so that they can be differentiated by screen readers

Relates to angular#671.

* fix(component-nav): remove aria-label that duplicates messages

- aria-expanded already covers whether the section can be toggled or not
- the button's text content already covers the accessible name

Relates to angular#671.

* fix(header-link): remove title

- the aria-label is sufficient

Relates to angular#671.

* feat(theme-picker): provide a visual preview of the theme colors via an SVG

* fix(theme-picker,version-picker): add/improve aria-labels and tooltips

Fixes angular#671

* fix: various a11y refinements

- minify theme-demo-icon.svg
- use & instead of / as it reads better on a screen reader
- prefix classes with `docs-`
- tell screen reader users when a theme has been selected

Fixes angular#671
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