Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: PreventDefault in touchmove event #31

Closed
SinnerAir opened this issue Aug 3, 2020 · 6 comments
Closed

Question: PreventDefault in touchmove event #31

SinnerAir opened this issue Aug 3, 2020 · 6 comments
Labels
question Further information is requested
Milestone

Comments

@SinnerAir
Copy link

The code contains such a line https://github.com/rqrauhvmra/tobii/blob/ac432322c09dc30eba853a17b252250ba87ed453/src/js/tobii.js#L1234
Can you find out what it is for? Because it does not provide the ability to scale with a gesture.

@midzer midzer added the question Further information is requested label Jul 2, 2021
@midzer
Copy link
Owner

midzer commented Jul 2, 2021

@SinnerAir Sorry for no reply the whole time. What do you mean by scale with a gesture?

Touchmove event: triggered continuously when the finger is sliding on the screen. During this event, calling the preventdefault() event prevents scrolling.

via https://developpaper.com/implementation-of-html5-touch-events-touchstart-touchmove-and-touchend/

@viliusle
Copy link
Collaborator

viliusle commented Jul 3, 2021

scale with a gesture?

scale with two fingers holding, and moving away from each other?

@viliusle
Copy link
Collaborator

I just tested it, removing that line does not break navigation on mobile, but allows to zoom image using 2 fingers on mobile.

@midzer midzer added this to the v2.3.0 milestone Jul 29, 2021
@viliusle
Copy link
Collaborator

It should work on next version.

@midzer
Copy link
Owner

midzer commented Jul 31, 2021

I can't get this "2-finger-zoom" zoom working on my live site (Android and Safari). Image just moves as of switch the slides.

@viliusle Can you confirm this is working? I could test in develop branch demo if I update the dist files.

@viliusle
Copy link
Collaborator

viliusle commented Jul 31, 2021

I tested it again with latest develop branch code on android device, chrome browser. Zoom with 2 fingers works.

p.s. I was able to zoom actual page too, but even i tap on image and modal window is activated, I still can zoom it, but I see that page itself zooms too in background. So it is not only image zoom, but zoom everything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants