mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
switch touch fix
This commit is contained in:
@ -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) {
|
||||
|
Reference in New Issue
Block a user