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

nipplejs get stuck in iphone when switch app #61

Closed
adriancabouli opened this issue Nov 22, 2017 · 8 comments
Closed

nipplejs get stuck in iphone when switch app #61

adriancabouli opened this issue Nov 22, 2017 · 8 comments

Comments

@adriancabouli
Copy link

hi, i am having troubles with the plugin. I made a game, and use the nipplejs like a joystick. When, (by mistake) the user switch the app to another, or try to, and in that moment is moving the joystick, when returns back to the app, the joystick became stuck in the last position that it was. And then is no way back, it always keep like that. I made a code that if i leave completly the app, (it calls in jquery VisibilityHidden) i remove nipplejs and create new instance. But the problem appear if i switch to another app and return back instantly to my game, or also when the apps are showing in "select app to switch" in iphone, and i am keeping moving the joystick. It happens a lot with iphone x cause the status bar in landscape mode is always visible and close to the joystick, so is probbably that the bug problem happen more than once. Thanks!

@adriancabouli
Copy link
Author

i also made an easy test to reproduce the error. If a alert("bla bla") box appear when i am moving the joystick it will get stuck too! (always in iphone i am testing). thks!!

@yoannmoinet
Copy link
Owner

I'll have a look as soon as I have time.

PR are more than welcome.

@adriancabouli
Copy link
Author

adriancabouli commented Nov 27, 2017 via email

@adriancabouli
Copy link
Author

touchcancel event it fix the problem!,

$(document).on('touchcancel', function(event) {
REMOVE_AND_CREATE_JOYSTIC() // or whatever...
});

@yoannmoinet
Copy link
Owner

I'll be damned... did you test it in every issues you've answered?
Thanks a lot for finding this out anyway.
I'll think of a solution to add this in the library.

@adriancabouli
Copy link
Author

adriancabouli commented Nov 28, 2017 via email

@adriancabouli
Copy link
Author

HERE for iphone 7 and > (iphone x compatible), is my game using the plugin!, in the new release the error is fixed.
It would be great if my game is spread! Thks in advance!

https://itunes.apple.com/us/app/partners/id1294121944?l=es&ls=1&mt=8

@tonyka
Copy link

tonyka commented Nov 30, 2017

@adriancabouli this works better for me:

$(window).on('touchcancel', function(e) {
    nipple.processOnEnd(e);
})

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

No branches or pull requests

3 participants