Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mouse wheel zooms too fast in FF #1794

Closed
klimashkin opened this issue Jun 26, 2013 · 22 comments
Closed

Mouse wheel zooms too fast in FF #1794

klimashkin opened this issue Jun 26, 2013 · 22 comments
Assignees
Labels
blocker Critical issue or PR that must be resolved before the next release
Milestone

Comments

@klimashkin
Copy link

One mousewheel zooms page 3 times.
Leaflet 0.6, FF 22

@ghost ghost assigned jfirebaugh Jun 26, 2013
@mourner
Copy link
Member

mourner commented Jun 26, 2013

Yep, @jfirebaugh is now investigating that issue...

@jfirebaugh
Copy link
Member

@klimashkin can you run this and post the results along with what mouse hardware you have?

@klimashkin
Copy link
Author

OK
Windows 7, FF22, Mousewheel

Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20100101 Firefox/22.0
wheel: deltaY=3, deltaMode=1

@jfirebaugh
Copy link
Member

Results

Ubuntu, FF 22, Trackpad (same with scroll mouse):

Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:22.0) Gecko/20100101 Firefox/22.0
wheel: deltaY=3, deltaMode=1

Windows, FF 22, Mouse:

Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20100101 Firefox/22.0
wheel: deltaY=3, deltaMode=1

MacOS, FF 22, Trackpad:

Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:22.0) Gecko/20100101 Firefox/22.0
wheel: deltaY=1, deltaMode=0

MacOS, FF 22, Generic Scroll Mouse:

Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:22.0) Gecko/20100101 Firefox/22.0
wheel: deltaY=0.100006103515625, deltaMode=1

MacOS, FF 22, Mighty Mouse:

Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:22.0) Gecko/20100101 Firefox/22.0
wheel: deltaY=0, deltaMode=0
wheel: deltaY=1, deltaMode=0
wheel: deltaY=6, deltaMode=0
wheel: deltaY=9, deltaMode=0

Ubuntu, Chromium, Trackpad (same with scroll mouse):

Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Ubuntu Chromium/25.0.1364.160 Chrome/25.0.1364.160 Safari/537.22
mousewheel: wheelDelta=-120, detail=0

MacOS, Chrome, Trackpad:

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36
mousewheel: wheelDelta=3, detail=0

MacOS, Safari, Mouse:

mousewheel: wheelDelta=12, detail=0

MacOS, Chrome, Generic Scroll Mouse:

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36
mousewheel: wheelDelta=120, detail=0

MacOS, Chrome, Mighty Mouse:

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36
mousewheel: wheelDelta=3, detail=0

@klimashkin
Copy link
Author

Firefox rocks! Different deltaY in different OS. Maybe it's issue for Mozilla tracker?

@jfirebaugh
Copy link
Member

@klimashkin trackpad or mouse?

@klimashkin
Copy link
Author

Mouse, updated

@klimashkin
Copy link
Author

Update. Received such results on Windows 7, FF22:

Mousewheel deltaY: 3 - 24 (step 3)
Trackpad deltaY: 0.1 - 11 (step 0.05)
(And always deltaMode=1)

@ajbeaven
Copy link
Contributor

This is hitting us too. Windows 7, FF 21, Mouse.

Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0
wheel: deltaY=3, deltaMode=1

@mourner
Copy link
Member

mourner commented Jun 27, 2013

@jfirebaugh should we just revert the wheel change generally for now but add a preventDefault on it just for fixing the FF scrolling issue?

@mourner
Copy link
Member

mourner commented Jun 27, 2013

Or maybe we should make another JSFiddle — gathering data for only FF but for all events (wheel, DOMMouseScroll and MozMousePixelScroll) at the same time.

@jfirebaugh
Copy link
Member

should we just revert the wheel change generally for now but add a preventDefault on it just for fixing the FF scrolling issue?

If you preventDefault on wheel you don't get any DOMMouseScroll events, so that won't work.

So far it's looking like we'll need to divide deltaY by 3 when deltaMode=1. That will result in an even smaller value on MacOS, FF 22, Generic Scroll Mouse, but since the ceiling is taken anyway it shouldn't matter.

@mourner
Copy link
Member

mourner commented Jun 27, 2013

Sounds good to me. It won't affect other browsers right?

@jfirebaugh
Copy link
Member

It won't affect other browsers right?

Not yet anyway. If other browsers start implementing "wheel" event that could change.

Here's a fiddle that records all Firefox wheel-related data: http://jsfiddle.net/ydVda/1/

One thing I notice is that with a Mac trackpad, several "wheel" events can be dispatched before a DOMMouseScroll is dispatched. This agrees with the documentation: "A vertical DOMMouseScroll event in both event group if accumulated deltaY of consecutive wheel events become larger than 1.0 or less than -1.0". This implies several things:

  • With Leaflet 0.5, small trackpad movements didn't generate a zoom, while with 0.6 they do.
  • The original bug with zoom events also scrolling the page is only reproducible when there are several "wheel" events before accumulating a DOMMouseScroll event. This may only be possible with a trackpad -- in my tests I always see a one-to-one correspondence between wheel and DOMMouseScroll events with wheel mice.

@mindplay-dk
Copy link

This still affects me in Firefox 26.0 under Windows 8 with an IntelliMouse Explorer 3.0 - the Leaflet on the front page of the website jumps two or three zoom levels when using the wheel.

Event log for a single up and down motion:

Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36
wheel: deltaY=-133.3333282470703, deltaMode=0
wheel: deltaY=133.3333282470703, deltaMode=0

Man, mouse-wheel events are just totally botched across browsers, sheeeesh...

@mourner
Copy link
Member

mourner commented Jan 14, 2014

@mindplay-dk yeah, programming for scroll wheels and trackpads is such a pain... One more related issue: #2154 I'm going to completely rewrite the way zoom animations and scroll wheels work, stay tuned for updates in master in the following weeks.

@michaelzed
Copy link

I find the otherwise excellent Magic Mouse scrolling very frustrating in Leaflet (e.g., on OpenStreetMap.org in Safari). Just trying to pan around the map causes many unintentional zooms in or out. Zooming often overshoots. Is this covered here, or should I open another bug?

@ganeshx
Copy link

ganeshx commented Jan 22, 2016

Has this issue been fixed? The zoom in/out is too sensitive

@mourner
Copy link
Member

mourner commented Jan 22, 2016

@ganeshx can you try the master version?

@CramericaIndustries
Copy link

Sorry but that bug is back. Tested with Fire Fox 54.0.1 and Leaflet 1.1.0. Chrome works fine (v59.0.3071.115).
Example map: http://leafletjs.com/

@perliedman
Copy link
Member

@CramericaIndustries please open a new issue if you believe this is a bug in the current Leaflet release, it's highly unlikely it's related to this four year old issue.

@CramericaIndustries
Copy link

CramericaIndustries commented Jul 28, 2018

Root of the problem was that the mousewheel.with_alt.delta_multiplier_y parameter was set to 500 (default 100) in about:config.
However scrolling on normal html-sites went much slower then, but was able to speed it up again by setting mousewheel.acceleration.start to 1. This setting had no effect on Leaflet.

Maybe this helps other poeple having the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker Critical issue or PR that must be resolved before the next release
Projects
None yet
Development

No branches or pull requests

9 participants