asked
2021-03-21 03:09:01 +0800
Bobzk 444 ● 1 ● 8 On a mobile, I can not find a way to handle just the left/right swipe.
The following (sudo/python) code works but is not what I want :
def doSwipe_hd_image_div(self, event):
real_event = Events.getRealOrigin(event)
if real_event.getSwipeDirection() == "right":
self.doClick_left()
elif real_event.getSwipeDirection() == "left":
self.doClick_right()
elif real_event.getSwipeDirection() == "up":
print "propo", real_event.isPropagatable()
Clients.scrollBy(0, +100)
else:
print "propo", real_event.isPropagatable()
Clients.scrollBy(0, -100)
I do not want to do the "Clients.scrollBy" I want the default browser behavior to occur (i.e. smooth scroll up/down).
In theory the event should propagate as isPropagatable is True.
I have tried to utilize client side w:onSwipe, w:onSwipe_ and w:doSwipe but without success.
It appears that as soon as you handle "swipe" (server side or client side) you have to do it all.
Any suggestions?
providing a runnable/working/failing java example will widen the target audience being able to help. E.g. on https://zkfiddle.org
cor3000 ( 2021-03-22 10:33:20 +0800 )editFYI and anyone else interested there seems to be a fix for touchSwipe and the "attempt to cancel ..." message logged.
See https://github.com/mattbryson/TouchSwipe-Jquery-Plugin/pull/362/files
But the fix does not seem to be committed to the master yet.
Bobzk ( 2021-03-24 21:43:09 +0800 )edit