Jump to content

Avoid scrolling on mobile devices


Recommended Posts


I have this Phaser 3 game inside a website. It fits a div container.

At some point, you can write on a HTML input to save your score. After the mobile keyboard pops up, the canvas scrolls up and everything starts to fail. The sprites coordinates stay fixed, but the canvas keeps the scroll, even when the keyboard is already closed.

I think the solution may be related with the Scale Manager, but I can't figure out what.

This is my configuration. Thanks!

this.config = {
            version: '0.0.1',
            type: Phaser.AUTO,
            parent: 'phaserContainer',
            width: data.baseWidth,
            height: data.baseHeigth,
            scale: {
                mode: Phaser.Scale.RESIZE,
                autoCenter: Phaser.Scale.CENTER_HORIZONTALLY
            backgroundColor: '#000000',
            banner: {
                hidePhaser: false,
                text: '#fff00f'
            physics: {
                default: 'arcade'
            scene: [
Link to comment
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.

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.


  • Recently Browsing   0 members

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