mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
switch touch fix
This commit is contained in:
@ -63,6 +63,13 @@ class MediaSwitch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pointerDown(ev) {
|
pointerDown(ev) {
|
||||||
|
if (ev.type == 'touchstart') {
|
||||||
|
this.isTouch = true;
|
||||||
|
}
|
||||||
|
if (this.isTouch && ev.type == 'mousedown') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.startX = pointerCoord(ev).x;
|
this.startX = pointerCoord(ev).x;
|
||||||
|
|
||||||
this.removeMoveListener();
|
this.removeMoveListener();
|
||||||
@ -72,6 +79,10 @@ class MediaSwitch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pointerUp(ev) {
|
pointerUp(ev) {
|
||||||
|
if (this.isTouch && ev.type == 'mouseup') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let endX = pointerCoord(ev).x;
|
let endX = pointerCoord(ev).x;
|
||||||
|
|
||||||
if (this.swtch.checked) {
|
if (this.swtch.checked) {
|
||||||
|
Reference in New Issue
Block a user