-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Ensure DragRotate stops when the window looses focus. Fixes #3389 #4390
Conversation
src/ui/handler/drag_rotate.js
Outdated
*/ | ||
_onBlur(e) { | ||
this._onUp(e); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since there's nothing else going on, can we just pass this._onUp
instead of adding an identical method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the tip. I've changed it. Note that you'll need to apply #4389 before this one.
This is incomplete, I need to apply the same logic to the |
I've updated it to apply the same logic to DragPan to fix the same behaviour when dragging.
|
I see no harm in following up on these edge cases if/when they are reported. What's here is a huge improvement over what we have now! 🚢 |
I'm not able to repro the bug in master right now. Can you confirm that the bug is still present in
|
Agreed.
@lucaswoj I presume you mean #3389 (changing windows). I can't test that as it was reported on OSX. I presumed it was the same as changing tabs in Chrome which I can test, and this PR addresses, but maybe not. |
I can sometimes repro changing tabs 👍 LGTM! |
… (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
Launch Checklist
The depends on #4389. Without it you might not observe this PR fixing the issue.
Ensure DragRotate stops when the window looses focus. Fixes #3389
I couldn't find any existing unit tests for DragRotate.
Manually tested on Linux with Chrome and Firefox (with #4389 applied).