Jump to content

Firefox Mac scrolling page and scene


Recommended Posts

Hi everyone

So I'm back in to looking at Baylon after having to concentrate on other areas of my project first.

I'm at the stage now where I'm loading a .babylon file exported from Blender, I'm attaching camera controls to the active camera (configured in blender to be Arc), and I'm using Pep instead of Hand for the interactions because Hand hates me and I don't deserve nice things.

Anyway here's the issue, with the camera controls attached as so:

scene.activeCamera.attachControl( canvas, false );

everything works fine in Mac safari 11.0.3 and Chrome 63.0.3239.132, but when in Firefox 58.01 the page scrolls as well as the scene when using the mouse wheel to zoom.

I've tried setting that false value to true, but all that did was stop scene scrolling everywhere.

The canvas element has the attribute:


set in the html and the similar declaration in CSS.

This wouldn't be such a problem if the entire scene was the whole page, but in my case the canvas is only part of the visible page.

Can someone shed some light on this please?


Link to comment
Share on other sites

4 hours ago, Deltakosh said:

we faced this bug recently with Firefox and we ended up fixing it by calling touch-action with BOTH html and CSS (See sandbox.babylonjs.com)

Thanks for the reply. I'd appreciate a little more on this if possible because I took a look at the sandbox site and tested in Firefox. Sure enough the whole page didn't move but I have some observations:

1) the canvas is the full size of the page, with the bottom HTML footer absolutely positioned over it. In my situation the canvas is just a small part of the page.

2) I looked at the code and noticed the HTML element does not declare "touch-action"; it only appears to be defined in the CSS where you also define the Microsoft -ms- variant. In my setup I already have touch-action defined on the HTML element and in the CSS, so I'm presuming this is not related to the fix you mention? Incidentally I added that -ms- variant "just in case" it was critical (knowing full well it wouldn't be) and sure enough nothing changed.

Would be great to get some further insight from you.


Link to comment
Share on other sites

6 hours ago, Deltakosh said:

Oh yeah actually I remember..We had to remove it from HTML and only use CSS to make it works (sorry about the confusion)

A quick update and check later and... nope, still the page scrolls. This seems to be a bigger issue than I first realised. I'm going to mitigate the issue as best I can by showing a full screen canvas instead, as it seems any canvas that is not full screen will have this issue in FF58 (on Mac, at least).

Thanks for your input.

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...