Hi, I am writing an app that where in I can swipe continuously on an element, however when I swipe first it works, but while (am assuming - its in its inertial state) I swipe again it doesn't work, however when I do the same after a few seconds (this is
the reason for my assumption - that inertia would have died by then), I can swipe again.
How to get continuous swipes working?
I am currently using MSGesture for gesture recognizer, and creating a new one every time the user starts to swipe on the device.
my pseudocode
function handleEverything() {
...
myElement.addEventListener("onPointerDown", onPointerDown);
myElement.style.msTouchAction = "pan-y";
...
}
function onPointerDown(event) {
gestureRecognizer = new MSGesture();
gestureRecognizer.target = myElement;
if (swipe) {
myElement.addEventListener("MSGestureStart", onMSGestureStart);
myElement.addEventListener("MSGestureChange", onMSGestureChange);
myElement.addEventListener("MSInertiaStart", onMSInertiaStart);
}
myElement.addEventListener("MSGestureEnd", removeEventListeners);
gestureRecognizer.addPointer(event.pointerId);
}
function onMSGestureChanged() {
handleSwipeDelta();
}
function onMSInertiaStart() {
startInertia();
}
function removeEventListeners() {
if (gestureRecognizer) {
gestureRecognizer.target = null;
gestureRecognizer = null;
}
stopInertia();
myElement.removeEventListener("MSGestureStart", onMSGestureStart);
myElement.removeEventListener("MSGestureChange", onMSGestureChange);
myElement.removeEventListener("MSInertiaStart", onMSInertiaStart);
myElement.removeEventListener("MSGestureEnd", removeEventListeners);
}
I am not sure if there is something that I need to do in addition to this and/or as part of the css for that element.
Regards, Rv.