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

MS Windows Desktop - wrong cooperativeGestures zoom behavior in unfocussed pages #2192

Closed
paf-quatico opened this issue Feb 15, 2023 · 6 comments
Labels
bug Something isn't working PR is more than welcomed Extra attention is needed

Comments

@paf-quatico
Copy link

maplibre-gl-js version:
latest (2.4.0)
option cooperativeGestures true

browser:
Any MS Windows browser (chrome, edge, firefox)

Steps to Trigger Behavior

First, it's important to understand, that CTRL + Scroll in MS Windows triggers a page zoom.

  1. On Desktop with a mousewheel device visit an https://jsfiddle.net/br6ugym5/
  2. Click on any area outside the jsfiddle preview iframe, or any other window, so that the jsfiddle preview window loses focus - but the map is still visible
  3. Move the mouse pointer over the map
  4. Hit CTRL + Scroll the mouse wheel in/out

Link to Demonstration

https://jsfiddle.net/br6ugym5/
https://user-images.githubusercontent.com/117347518/218996980-d9316432-8dc0-49d7-a940-aa62e0193dd2.mp4

Expected behavior

As in mapbox https://docs.mapbox.com/mapbox-gl-js/example/cooperative-gestures/
When the mouse hovers the page area, a CTRL + mousewheel scroll triggers a page scroll
When the mouse hovers the map area, a CTRL + mousewheel scroll triggers a map scroll

Actual behavior

When the mouse hovers the map area, a CTRL + mousewheel scroll triggers page scroll and the map area shows the message "Use CTRL + Scroll to zoom the map" (note: CTRL is hit, it's just that the jsfiddle preview iframe doesn't have focus)

Related tickets

See #234
See #1234

@HarelM
Copy link
Collaborator

HarelM commented Feb 15, 2023

Thanks! probably a missing e.preventDefaults() somewhere...
feel free to submit a PR to fix this.

@HarelM HarelM added bug Something isn't working PR is more than welcomed Extra attention is needed labels Feb 15, 2023
@HarelM
Copy link
Collaborator

HarelM commented Feb 15, 2023

cc: @kevinschaul @ewagstaff

@kevinschaul
Copy link
Contributor

@paf-quatico I wonder if this may have been fixed in #2152. Are you able to test this out with the latest code on the main branch?

@paf-quatico
Copy link
Author

@kevinschaul you are 100% correct. With the latest main branch I cannot reproduce the issue, anymore. Thank you!

@HarelM
Copy link
Collaborator

HarelM commented Feb 16, 2023

@paf-quatico can you close this issue if latest main doesn't have it?

@paf-quatico
Copy link
Author

I cannot reproduce the behavior after commit #2152
However I cannot rule out that it was fixed in an earlier commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working PR is more than welcomed Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants