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

Commit 316b4c8

Browse files
AndroguideThomasBurleson
authored andcommitted
fix(switch): inverted logic in md-switch dragging
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.
1 parent f3ad525 commit 316b4c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/switch/switch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ function MdSwitch(mdCheckboxDirective, $mdTheming, $mdUtil, $document, $mdConsta
136136

137137
// We changed if there is no distance (this is a click a click),
138138
// or if the drag distance is >50% of the total.
139-
var isChanged = ngModel.$viewValue ? drag.translate < 0.5 : drag.translate > 0.5;
139+
var isChanged = ngModel.$viewValue ? drag.translate > 0.5 : drag.translate < 0.5;
140140
if (isChanged) {
141141
applyModelValue(!ngModel.$viewValue);
142142
}

0 commit comments

Comments
 (0)