Skip to content

Commit

Permalink
fix(slide-toggle): remove unused mousedown listener (#4184)
Browse files Browse the repository at this point in the history
  • Loading branch information
devversion authored and kara committed Apr 21, 2017
1 parent 29968b8 commit e82d0f1
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/lib/slide-toggle/slide-toggle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ let nextId = 0;
'[class.mat-checked]': 'checked',
'[class.mat-disabled]': 'disabled',
'[class.mat-slide-toggle-label-before]': 'labelPosition == "before"',
'(mousedown)': '_setMousedown()'
},
templateUrl: 'slide-toggle.html',
styleUrls: ['slide-toggle.css'],
Expand All @@ -66,7 +65,6 @@ export class MdSlideToggle implements OnDestroy, AfterContentInit, ControlValueA
// A unique id for the slide-toggle. By default the id is auto-generated.
private _uniqueId = `md-slide-toggle-${++nextId}`;
private _color: string;
private _isMousedown: boolean = false;
private _slideRenderer: SlideToggleRenderer = null;
private _disabled: boolean = false;
private _required: boolean = false;
Expand Down Expand Up @@ -175,15 +173,6 @@ export class MdSlideToggle implements OnDestroy, AfterContentInit, ControlValueA
event.stopPropagation();
}

_setMousedown() {
// We only *show* the focus style when focus has come to the button via the keyboard.
// The Material Design spec is silent on this topic, and without doing this, the
// button continues to look :active after clicking.
// @see http://marcysutton.com/button-focus-hell/
this._isMousedown = true;
setTimeout(() => this._isMousedown = false, 100);
}

/** Implemented as part of ControlValueAccessor. */
writeValue(value: any): void {
this.checked = value;
Expand Down

0 comments on commit e82d0f1

Please sign in to comment.