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

DOes not work in latest ios #25

Closed
sandeepsahoogirik opened this issue Jul 5, 2018 · 9 comments
Closed

DOes not work in latest ios #25

sandeepsahoogirik opened this issue Jul 5, 2018 · 9 comments

Comments

@sandeepsahoogirik
Copy link

Hi
This does not seems to work in Iphone safari - latest ios.
We have a similar code and it seems to have the same issue.
When I try this on my laptop it works without any issue and so does my code but in iOS it does not seem to work.
Kind Regards
Sandeep

@sandeepsahoogirik
Copy link
Author

Got it to work I replaced the following
$(document).on('touchmove', function (e) {
if (e.target.tagName == "CANVAS") {
e.preventDefault();
}
}
with
window.addEventListener('touchmove', function (e) {
if (e.target.tagName == "CANVAS") {
e.preventDefault();
}
}, { passive: false });

The passive false is imp.

Basically the call is

window.addEventListener('touchmove', func, { passive: false })

@SergeyLukashov
Copy link

Hi,
I faced the same issue for latest iOS. Even { passive: false } for event listener doesn't seem to work to me. Is there another workaround?

@sandeepsahoogirik
Copy link
Author

Hi
Please note the only way I was able to get this to work was to add the event listener on the window object
window.addEventListener

It does not work where I use the "document"

Kind Regards
Sandeep

@SergeyLukashov
Copy link

Thanks Sandeep! That may be the cause - will try it.

@skarakash
Copy link

so is this fixed for ios 11> ?

@sandeepsahoogirik
Copy link
Author

It did for our project.
You can check the pages we are using this on

https://www.oka.com/cushion-arranger/

Kind Regards
Sandeep

@inkquery
Copy link

There is a way to use it without npm or yarn ? pure JS, no require ?

@willmcpo
Copy link
Owner

Closing issue as it appears the latest ios > 11 fixed the issue.

@willmcpo
Copy link
Owner

@inkquery not without some work on your end.

To do what you want, you first need to download npm/yarn =). But after that, just fork/clone the repo, then run yarn build. Then grab the file with the compiled javascript code, make some mods to expose the logic globally....

As its open source, feel free to do above, as long as credit is provided where due =)

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

No branches or pull requests

5 participants