Jump to content

Touch Events inside iframe on Chrome for iOS not firing


paradiddle
 Share

Recommended Posts

Hi guys,

 

I'm starting to go a little insane trying to figure this out, so any help would be appreciated.

 

Touch events on the Phaser canvas aren't registering, but only in an iframe with Chrome for iOS. Other mobile browsers and desktop browsers work fine.

 

It works when the game isn't in an iframe, and touches on other elements inside the iframe register just fine. After dozens of different fixes from numerous sources and lots of debugging, I'm pretty sure the problem lies with the canvas itself and not with the iframe or surrounding elements. I've tried setting a bunch of properties on the canvas like pointer-events and user-select, just on the off chance thats its a simple setting, but nothing has worked. Has anyone else experienced this?

 

The code that goes with this is large and rather fragmented, but at this point I'm guessing its a default setting of Phaser that I'm not overriding, so I doubt my existing code would be that helpful.

Link to comment
Share on other sites

  • 2 months later...

Sorry for the resurrection, but maybe it saves someone else an afternoon of work. Debugging Chrome on iOS is hell.

 

For us, it seemed as touch events weren't registering, but they actually were. It was just the game that was paused.

For some reason Phaser registers a loss of visibility on touch. This only seems to happen in an iframe in Chrome on iOS. Setting game.stage.disableVisibilityChange to true fixed it for us.

Link to comment
Share on other sites

  • 2 weeks later...

Sorry for the resurrection, but maybe it saves someone else an afternoon of work. Debugging Chrome on iOS is hell.

 

For us, it seemed as touch events weren't registering, but they actually were. It was just the game that was paused.

For some reason Phaser registers a loss of visibility on touch. This only seems to happen in an iframe in Chrome on iOS. Setting game.stage.disableVisibilityChange to true fixed it for us.

 

Thanks for this.  Just saw this happen to us with 2.4.4.

Link to comment
Share on other sites

  • 2 weeks later...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...