stuyam / pressure

:point_down::boom: JavaScript library for handling Force Touch, 3D Touch, and Pointer Pressure.
https://pressurejs.com
MIT License
2.92k stars 97 forks source link

Prevent error while pinch to zoom #55

Closed davidshimjs closed 8 years ago

davidshimjs commented 8 years ago

selectTouch method can't find element while pinch to zoom actions In iOS Safari(on 10.1.1). I think target elements would be changed continuously.

stuyam commented 8 years ago

Hey @davidshimjs thanks for the pull request. Can you explain to me more about the issue you found? What are the steps you took to reproduce the issue that you saw?

davidshimjs commented 8 years ago

You can see the issue with Google Map. It supports pinch to zoom. If you set Pressure.set() on Google map element, you can see the error in console.

stuyam commented 8 years ago

@davidshimjs can you maybe make an example of this to test in a gist? Here is my example that I tried with google maps and I did not see any errors but I don't know if I set it up right: https://gist.github.com/stuyam/c294bb78011442833e1dd5f696276e1b

davidshimjs commented 8 years ago

Google maps prevent all touch events in map area. so, I have prepared other sample source. http://output.jsbin.com/loretehume It contains Naver maps(in south korea map). If you connect this page on your mobile device, you can find error when doing pinch to zoom. and you can also check out source here http://jsbin.com/loretehume/edit?html

_ _ _david_ _safari_ _output_jsbin_com_ _loretehume
stuyam commented 8 years ago

Thanks for the extra info!