dorukeker / gyronorm.js

JavaScript project for accessing and normalizing the accelerometer and gyroscope data on mobile devices
MIT License
641 stars 65 forks source link

shake to undo gets triggered #47

Closed vin-ni closed 6 years ago

vin-ni commented 6 years ago

I'm filling out an input field, before starting a game that is played by shaking the phone. Unfortunately, on iOS, this triggers the « Shake to Undo».

How can I add a event.stopPropagation(); to the original event, to stop this behaviour?

Thanks

dorukeker commented 6 years ago

AFAIK Shake-to-undo is OS level. I dont think you can control it from the browser. Why don't you have two HTML pages? :)

Get the input in the first. Enter/submit gets you to the second page where you have the game.

Question is not directly related to the library so I am closing it as an issue. Feel free to continue the conversation though.

Cheers, D.

vin-ni commented 6 years ago

hmm, unfortunately I need to stay on the same page. I found some sources where they said that I could prohibit this with stopPropagation somehow. I'll do some tests.

dorukeker commented 6 years ago

A quick search: https://stackoverflow.com/questions/6520125/how-to-disable-ios-shake-to-undo-in-a-webapp The second reply here can be use full.

Cheers, D.

vin-ni commented 6 years ago

Yes, I finally used the third answer, which worked perfectly (I dont need emoji) https://stackoverflow.com/a/43481473/1779355

dorukeker commented 6 years ago

Glad that it worked!