scrollViewer horizontal direction is in reverse

Hey, apologies if this is already fixed, or if I already posted this:


  • Bug repro on playground
  • Expected result: if I use a track pad and drag:
    • down on the image, the image goes down (the scroll bar goes up)
    • drag left on the image, the image goes left (the scroll bar goes right)
  • Current result:
    • down on the image, the image correctly goes down (the scroll bar correctly goes up)
    • drag left on the image, the image incorrectly goes right (the scroll bar incorrectly goes left)

Additional Context
If you try dragging left or right on the code text pane then you can see it operates differently from the scrollViewer

I don’t think this is a bug. By giving no instructions you are just using the default pointer behavior.
If you want to change this behavior, you can do your custom settings for that.
Let me just have @carolhmj confirm this (or confirm it is a bug). Shouldn’t be too long…

Thank you for checking mawa! :slight_smile: Regarding this point:

The default html text scrolling behaviour is the same as the scrollViewer for vertical scrolling but opposite for horizontal. If you try horizontally scrolling the code in the text panel on the left of the playground you can see it behaves the opposite of the scrollViewer’s horizontal scroll behaviour.

I know. I just don’t know if it’s the expected behavior. I’m experiencing this all the time in (non BJS) sites. I find it annoying but then may be it’s just me :thinking:

Yep mawa I checked and I also see the two behaviors :stuck_out_tongue: It seems that there are two “competing” types of scrolling: Natural scrolling (Mac) vs Reverse scrolling (Windows) | by Kunal Rathore | Bootcamp ( So I don’t think this is a bug, but we could add an option to reverse the vertical/horizontal scrolling direction as a new feature.


I think like I this idea. :+1:

Right, this is useful thanks. This is helping me unpack my itch haha :grin: … I now realise that I don’t mind either way, the so called “natural” or “reverse”, I just think they should both (vertical and horizontal) be one or the other. However if this is how it works on Windows then let’s definitely leave as is. And I guess we’d need to leave as is anyway to make it backwards compatible.

So yes I would be grateful if a boolean option to reverse scrolling was debated as a potential addition.

Opened a PR with that if you’d like to check the behavior and see if it’s what you expect: Add boolean invertDirection to allow inverting the scrollbar navigati… by carolhmj · Pull Request #12867 · BabylonJS/Babylon.js ( :smiley:


Thanks @carolhmj ! I’m not yet set up to try this specific branch of BabylonJS locally but I superficially looked at the code and this looks good to me.