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

Map remains in change camera mode (control key) after changing windows #3389

Closed
bsudekum opened this issue Oct 14, 2016 · 3 comments · Fixed by #4390
Closed

Map remains in change camera mode (control key) after changing windows #3389

bsudekum opened this issue Oct 14, 2016 · 3 comments · Fixed by #4390
Labels

Comments

@bsudekum
Copy link

mapbox-gl-js version: v0.26.0

  • mac
  • chrome 53.0.2785.143

Steps to Trigger Behavior

  1. Use the control key change the camera on the map
  2. Quickly change windows with command + tab
  3. Go back to chrome
  4. Map remains in change camera mode even though the control key has been released

Expected Behavior

The map would not be remain in change camera/pitch mode since the control key is not pressed.

Actual Behavior

The map remains in change camera/pitch mode even though the control key is not pressed.

@andrewharvey
Copy link
Collaborator

I can reproduce this on Linux Chrome 55 without changing window.

  1. Press and hold Ctrl
  2. Press and hold Left Mouse button
  3. Release Ctrl
    (can still rotate/pitch which I would expect to be able to)
  4. Release Left Mouse Button
    (map still stuck in rotate/pitch even though both Ctrl and Left Mouse button are released.

@stevage
Copy link
Contributor

stevage commented Jan 4, 2017

Yeah, I get this on both Mac and Windows.

The good news is that you can "unstick" the key by doing the reverse:

  1. Press and hold mouse button
  2. Press and hold mouse Ctrl
  3. Release mouse button
  4. Release Ctrl

@andrewharvey
Copy link
Collaborator

andrewharvey commented Mar 9, 2017

@bsudekum, I submitted a PR to try to fix this, however I've just realised it doesn't address your exact report.

The way the DragRotateHandler works at the moment is if you let go of Ctrl/Command with the mouse still down, DragRotate is still active. I think this is how it should work. However at the moment if you have the mouse down and are drag rotating, and change tabs and then mouseup, when you change tabs back, even though the mouse is up the map is still rotating. That's the bug I've tried to fix.

andrewharvey added a commit to andrewharvey/mapbox-gl-js that referenced this issue Mar 9, 2017
lucaswoj pushed a commit that referenced this issue Mar 16, 2017
)

* Ensure DragRotate stops when the window looses focus. Fixes #3389

* simplify approach to de-activate DragRotate when the window loosese focus

* de-activate DragPan when window loosese focus
andrewharvey added a commit to andrewharvey/mapbox-gl-js that referenced this issue Mar 17, 2017
… (mapbox#4390)

* Ensure DragRotate stops when the window looses focus. Fixes mapbox#3389

* simplify approach to de-activate DragRotate when the window loosese focus

* de-activate DragPan when window loosese focus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants