monaco-editor icon indicating copy to clipboard operation
monaco-editor copied to clipboard

Scrolling does not work in Firefox

Open spahnke opened this issue 7 years ago • 26 comments

monaco-editor version: 0.16.0 Browser: Firefox 65.0.1 OS: Windows 10

Steps or JS usage snippet reproducing the issue: Reproducible on the Monaco Website and in the playground.

Edit: It works with the keyboard (Ctrl+Up/Down), but not with the scroll wheel.

spahnke avatar Mar 08 '19 09:03 spahnke

monaco-editor version: 0.16.0 Browser: Firefox 67.0a1 Nightly OS: Windows 10

Also seeing this issue, only with the mouse scroll wheel.

Scroll bar click and drag works, as does Ctrl+Up/Down (as stated above)

jpetrucciani avatar Mar 15 '19 20:03 jpetrucciani

I have also found this bug. My Monaco editor is wrapped in quite a few nested flex box divs and thought that might be issue but the example on the Monaco website suggests otherwise.

I'm using react-monaco-editor v0.25.1, which is using monaco-editor v0.16.0 under the hood. Browser: Firefox 65.0.1 OS: Mac OS 10.13.6

dodds-cc avatar Mar 19 '19 23:03 dodds-cc

Same issue on monaco-editor version: 0.16.2 Browser: Firefox 67.0b3 OS: Windows 10

olane avatar Mar 25 '19 17:03 olane

Same here monaco-editor: 0.16.2 browser: Firefox 67.0b3 OS: MacOS Mojave 10.14.3

georges-gomes avatar Mar 26 '19 08:03 georges-gomes

I was also having this issue. monaco-editor: 0.16.0 browser: Firefox 60.5.2esr OS: Windows 10

It seems the issue is being caused because Firefox doesn't recognize the "mousewheel" event. Instead Firefox uses the "DOMMouseScroll" event. To work around this, I added an extra line in both mouseHandler.js and scrollableElement.js .

\esm\vs\editor\browser\controller\mouseHandler.js: Before adding the event handler at the end of the MouseHandler constructor, register the "DOMMouseScroll" event for Firefox.

// IE9, Chrome, Safari, Opera
_this._register(dom.addDisposableListener(_this.viewHelper.viewDomNode, 'mousewheel', onMouseWheel, true));
// Firefox (added line)
_this._register(dom.addDisposableListener(_this.viewHelper.viewDomNode, 'DOMMouseScroll', onMouseWheel, true));

\esm\vs\base\browser\ui\scrollbar\scrollableEvent.js: Similarly, push the "DOMMouseScroll" event in the _setListeningToMouseWheel function.

// IE9, Chrome, Safari, Opera
this._mouseWheelToDispose.push(dom.addDisposableListener(this._listenOnDomNode, 'mousewheel', onMouseWheel));
// Firefox (added line)
this._mouseWheelToDispose.push(dom.addDisposableListener(this._listenOnDomNode, 'DOMMouseScroll', onMouseWheel));

For my own purposes, I also had to make similar changes to the \min\vs\editor\editor.main.js

cgillis-aras avatar Mar 26 '19 14:03 cgillis-aras

The mousewheel event is deprecated in favor of wheel (MDN), which all modern browsers (Firefox included) do understand.

yishn avatar Mar 26 '19 15:03 yishn

Having this issue also at 0.16.1

Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0 and macOS, Firefox 65.0.1

rudskoy avatar Apr 04 '19 17:04 rudskoy

I'm also encountering this bug

Mozilla/5.0 (X11; Linux x86_64; rv:66.0) Gecko/20100101 Firefox/66.0

@cgillis-aras looks like you found a solution -- maybe the Monaco team would accept a PR? :-D

bcolloran avatar Apr 21 '19 00:04 bcolloran

i went a head and filed a PR for this: https://github.com/Microsoft/vscode/pull/72832

as i mention there, unfortunately, @yishn's suggestion of just changing "mousewheel" -> "wheel" did not work for FF, but something based on @cgillis-aras's idea worked

bcolloran avatar Apr 25 '19 00:04 bcolloran

Just noticed this. I've been using monaco on webglfundamentals.org for years, didn't know they were broken in firefox until today. Did monaco change or firefox? This used to work. I guess I can go test.

greggman avatar Jul 01 '19 04:07 greggman

Okay, verified this is a regression. I was using monaco 0.9.0 until this weekend when I upgraded to 0.17.1. I works in v0.15.0 and fails in v0.16.0

Though it's always had issues in firefox even going back to 0.9.0

In 0.9.0 through 0.15.0 the mousewheel works but the page scrolls as well just slower (firefox only). Chrome and Safari the page doesn't scroll, only the editor contents.

Here's hoping whatever the fix is can make the behavior consistent. For now I'll switch back to an older version so at least the site is more functional.

greggman avatar Jul 01 '19 05:07 greggman

Compiler Explorer is in the process of upgrading from Monaco 0.10.1 to 0.17.1 and we spotted this too. We're debating whether this is a blocker or not: we may downgrade to 0.15 and see if that's acceptable.

mattgodbolt avatar Jul 12 '19 12:07 mattgodbolt

Hello team, When can we expect the good PR of @bcolloran to be merged ? ☺️

bodinsamuel avatar Jul 15 '19 13:07 bodinsamuel

This issue is fixed in VS Code master branch and will be released with next Monaco update.

rebornix avatar Jul 25 '19 21:07 rebornix

I wonder if this issue is related to the truncated copy/paste on Firefox in https://github.com/microsoft/monaco-editor/issues/1540

pombredanne avatar Aug 09 '19 13:08 pombredanne

Hello team, I was wondering when this Monaco update will be available? And is there any temporary patch available in meantime? @rebornix

zzeebbii avatar Aug 13 '19 07:08 zzeebbii

I am using 0.17.1 and the issue is still there. Any updates on the status of this bug?

DenysVuika avatar Sep 02 '19 20:09 DenysVuika

Hey @rebornix, Although the scroll issue in Firefox is fixed with new version of monaco-editor but speed of scrolling is very slow. It is scrolling one line at a time. You can check it on Monaco Website playground. I am using latest version of Firefox and I tried it in Firefox Developer Edition too. Same results. Should I create a new issue for this?

zzeebbii avatar Sep 05 '19 08:09 zzeebbii

Joining @zzeebbii 's message. Not only is the scrolling extremly slow, but also it works wonky with touchpad. Scrolling "up" works (slowly but not as bad as scrolling with mouse) but direction down does not work at all and just scrolls the whole page.

Browser version: firefox 69.0 OS: Windows 10 Pro - version 1903 - build number 18362.295

gippy avatar Sep 05 '19 08:09 gippy

I am using Firefox Developer Edition 70.0b3 and scrolling seems to be working fine for me.

DenysVuika avatar Sep 05 '19 09:09 DenysVuika