Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
fix(switch): inverted logic in md-switch dragging
Browse files Browse the repository at this point in the history
md-switch was being toggled when the user dragged less than half the way and didn't toggle when dragged more than half the way.
Invert this logic.

Fixes #4549. Closes #4560.
  • Loading branch information
Androguide authored and ThomasBurleson committed Sep 11, 2015
1 parent f3ad525 commit 316b4c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/switch/switch.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function MdSwitch(mdCheckboxDirective, $mdTheming, $mdUtil, $document, $mdConsta

// We changed if there is no distance (this is a click a click),
// or if the drag distance is >50% of the total.
var isChanged = ngModel.$viewValue ? drag.translate < 0.5 : drag.translate > 0.5;
var isChanged = ngModel.$viewValue ? drag.translate > 0.5 : drag.translate < 0.5;
if (isChanged) {
applyModelValue(!ngModel.$viewValue);
}
Expand Down

0 comments on commit 316b4c8

Please sign in to comment.