Closed ctwist closed 7 years ago
I have done some more testing, and my problem affects other devices. An old version of jquery-Touch-Events is reliable, but the latest version is unresponsive. I will investigate further; maybe my implementation needs to be changed.
If I still have a problem, I will open a separate issue.
Okay, thanks for the update. Please let me know if the issue is not fixed with further investigation. Out of interest, which version of the library works?
I have done some additional testing, using your demo. All tests were done in IE11 and Edge running on Windows 10.
I tested swiping with a finger and a stylus. I did not notice any difference in behaviour.
Issues:
1) In Edge, a swipe right causes the previous page to be loaded from history. This does not occur in IE11. Can you suppress propagation, or is this my responsibility?
2) I repeatedly swiped right. Approximately 80% of the time, this was interpreted as tapstart and taphold. Swipe recognition improved if I started to swipe before touching the screen, but it was still unreliable. If a gesture triggers both a swipe and a taphold, shouldn't the swipe take precedence, or can you give me an option so that I can specify which takes precedence? If taphold is triggered first (maybe because of a swipe threshold), can you wait to see if a swipe occurs before processing taphold?
3) I just use your software to manage swiping. To avoid wrong tap detection, can you give me an option to ignore tap events?
4) A swipe right is sometimes interpreted as swipe left. This is more reliable if I touch the screen lightly. A heavy touch is more likely to detect a swipe in the wrong direction. I am guessing that my initial touch is captured, and then my heavier touch covers a wider area and is interpreted as a movement. If this is correct, I suggest that you should ignore a "swipe" that is less than half the width of a finger tip.
You asked "which version of the library works?". There was a bug in my code, so maybe an older version of the library did not work better. Now that I have identified the precise problems, I don't think there is any point in trying to do historical testing.
Thanks for the detailed investigation, I'll try to tackle your points as you've raised them:
Preventing default behaviour of events (in this case touchmove
) is the responsibility of the end user I'm afraid, not the library.
Since you mention that you're only using the library to deal with swiping, why bind to tapstart
and taphold
at all? Surely you can just remove these bindings and the event handlers won't be called?
See answer above.
It does sound like the swipe threshold may be too low, so when you tap harder, it's actually trigger a swipe. Have you tried altering the thresholds via the data-
attributes as outlined here: https://github.com/benmajor/jQuery-Touch-Events#6-defining-thresholds?
Thanks, Ben.
My testing was done on your demo page. I wanted to test there first, so that we have a common test environment.
I will now continue testing my software. I already set a larger swipe threshold. I will have to add some diagnostics to see why swiping is failing.
Swiping did not work in Edge because the Windows 10 installer disables touch events. To fix this, enter "about:flags" in the Edge address bar and then set "enable touch events" to "always on".
The other 3 problems that I reported seem to be caused by a home network. The web pages were on a network drive. After I moved them to a local drive, swiping worked correctly. I don't know why there was a problem, but it is not important.
So, swiping is working for me. I did not need to adjust any threshold, as discussed in my previous comment.
I am using version 1.08.
I have a "Lenovo Miix 2 8" tablet, running Win10. In IE11 and Edge, swiping doesn't work. isTouchCapable is set to false. The userAgents are attached. I have not tried other web browsers.