-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Two-finger swipe on trackpad zooms map instead of panning #8649
Comments
Oh, I just noticed that this functionality was intentionally removed from Firefox for macOS in favor of letting scroll wheel mice zoom in and out: #8595 (comment) webcompat/web-bugs#73148. For what it’s worth, I never had a problem using both two-finger pan and scroll-wheel zoom in in iD v2.19 on my MacBook Pro in Firefox 91 or earlier. (I even briefly used Firefox 56 without any problems.) However, my mouse has a low-precision scroll wheel, not like an Apple mouse. |
(I goofed up, saved too soon, and ended up having to rewrite this comment and split out much of it as #5550 (comment). Sorry for jumping the gun with something that came off as accusatory.) #8595 seems to have conflated two different issues:
Only the latter relates to the the swipe-to-pan feature added in 45a3e58. 2270b5d closed the issue by disabling swipe-to-pan only in Firefox. I haven’t completely dug into the discussion at webcompat/web-bugs#73148, but there’s some disagreement as to whether it also reproduces in Chrome and Safari, so I wonder if other variables are at play. Completely disabling the feature seems like an overcorrection, while disabling it only in Firefox seems like an undercorrection, so hopefully we can find a more targeted fix. I tested iD before and after this change on macOS 10.13 using the following input devices:
I have
Ironically, if you use Firefox and a multitouch input device, you now have two ways to zoom without clicking (three with a trackpad) but no way to pan without clicking. |
This issue is important to me because the current behavior potentially puts some Firefox users at risk of injury. Panning is a much more common operation than zooming when mapping. My primary input device is a trackpad, though I do have a mouse that’s also affected by this issue. I experience carpal tunnel syndrome but have to click and drag constantly in order to map. For the past year, my workaround has been to spoof my user agent as Safari, but this should not be a requirement for users less familiar with Web development. So far, in Firefox 101 on macOS, I haven’t found any distinction in the DOM between |
I found a way to distinguish a multitouch mouse or trackpad (which should pan the map) from a scroll wheel mouse (which should zoom the map). By default, when a traditional scroll wheel mouse is connected, macOS adds a traditional scrollbar to any element that overflows with a scrollbar. Otherwise, macOS uses an overlay scrollbar, which doesn’t affect the size of anything contained inside the element. As a workaround for the issue above, we could add an invisible height: 100px;
overflow: scroll;
position: absolute;
top: -200px;
visibility: hidden;
width: 100px; then check the width of the let hasOverlayScrollbar = hiddenScrollingElement.scrollWidth == 100; If the scroll box’s width matches the element’s declared width, then overlay scrollbars are enabled. Otherwise, if the width is less, then traditional scrollbars are enabled. Overlay scrollbars are enabled when either a multitouch input device is connected or the “Show scroll bars” option in General Settings is set to “Always”: I think it’s safe to assume that most users have this preference set to “Automatically based on mouse or trackpad”. It isn’t difficult to set it to “Always” or use the trackpad while a mouse is connected. But these edge cases are so obscure that I think we can afford to regress them. |
RapiD has more or less addressed this issue by adding a user preference for the mouse wheel interaction mode: facebook/Rapid#680 (comment). If RapiD incorrectly detects a trackpad where it should detect a mouse wheel, the preference allows the user to override this default, avoiding injury from having to click and drag too often. |
Starting in v2.20.1, swiping with two fingers on a multitouch trackpad zooms the map in and out instead of panning in every direction. Reproduces in Firefox 91.0 on macOS. Does not reproduce in Safari 13.1.
/ref #8595
The text was updated successfully, but these errors were encountered: