From d1318881985d1daf170fd295422e4a0b2da55b9f Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Fri, 7 Aug 2015 11:15:32 -0500 Subject: [PATCH] switch touch fix --- ionic/components/switch/switch.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ionic/components/switch/switch.ts b/ionic/components/switch/switch.ts index 761d367fb9..0c37175cbb 100644 --- a/ionic/components/switch/switch.ts +++ b/ionic/components/switch/switch.ts @@ -63,6 +63,13 @@ class MediaSwitch { } pointerDown(ev) { + if (ev.type == 'touchstart') { + this.isTouch = true; + } + if (this.isTouch && ev.type == 'mousedown') { + return; + } + this.startX = pointerCoord(ev).x; this.removeMoveListener(); @@ -72,6 +79,10 @@ class MediaSwitch { } pointerUp(ev) { + if (this.isTouch && ev.type == 'mouseup') { + return; + } + let endX = pointerCoord(ev).x; if (this.swtch.checked) {