Sign in to follow this  
patrick99e99

is there a way to stop native iOS scroll-to-url-bar/notifications panel behavior?

Recommended Posts

I am testing out my game on iOS, and I have a 8-directional virtual joystick overlayed on screen (a circle divided into 8 slices), and am using pixi's interaction manager for pointerdown/pointerup/pointermove events to handle touch events for detecting which direction is currently being touched...  So as I am playing in full screen (iphone rotated in landscape mode), I am sliding my thumb around this "wheel", and Safari thinks "oh!  GESTURE!!!".. and then all of a sudden, a scroll bar appears and the url bar comes into view-- totally ruining the experience of my game..  And then as I continue to try to play, iOS is like "OH GESTURE!!!" and then a notifications panel comes down and covers half of the screen.. and then I throw my hands up in the air and ask myself, did I make a terrible mistake trying to make a browser based game, because this behavior is literally ruining everything...

 

Is there any way to "prevent default" on these events to stop this horrible and obnoxious behavior?

Share this post


Link to post
Share on other sites

You can get the touchmove from document and call preventdefault on that to block most of ios problems. Only thing I havent found a cure for is the swipe from left side of the screen to go to previous page. Other than overriding history with current page.

Remember to set your touchlistener with passive:false, like this: document.addEventListener("touchmove", {passive:false}). As apple changed their devices to use passive true as a default option for smoother scrolling.

Share this post


Link to post
Share on other sites

thanks for the reply..  But, if I am using pixi's interaction manager (pointerdown, pointerup, pointermove) via `renderer.plugins.interaction.on('pointermove', onPointerMove);`, then how am I supposed to handle the passive flag since I am not actually doing any document.addEventListeners ?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.