Snouto

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:

touch-action="none"

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?

Cheers

Share this post


Link to post
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.

Cheers

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.