Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/components/checkbox/checkbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
[attr.aria-labelledby]="ariaLabelledby"
(focus)="onInputFocus()"
(blur)="onInputBlur()"
(change)="onInteractionEvent($event)">
(change)="onInteractionEvent($event)"
(click)="onInteractionEvent($event)">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem right. What is the underlying bug you're trying to address?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

upon clicking, checkbox fires click function twice. Ideally it should fire it once right?

<div class="md-ink-ripple"></div>
<div class="md-checkbox-frame"></div>
<div class="md-checkbox-background">
Expand Down
4 changes: 2 additions & 2 deletions src/components/checkbox/checkbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,10 @@ export class MdCheckbox implements AfterContentInit, ControlValueAccessor {
onInteractionEvent(event: Event) {
// We always have to stop propagation on the change event.
// Otherwise the change event, from the input element, will bubble up and
// emit its event object to the `change` output.
// emit its event object to the `change` output.
event.stopPropagation();

if (!this.disabled) {
if (!this.disabled && event.type === 'change') {
this.toggle();
}
}
Expand Down