Ensure DragRotate stops after releasing mouse button when Ctrl is already released. Fixes #1888 #4389
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Launch Checklist
Fixes #1888. I've tried my best to test this doesn't have any other unintended consequences but it would be great if others can test it too.
In my view this is fairly high priority to fix as it creates a poor user experience and seems to affect quite a number of people.
I couldn't find any interaction unit tests for the DragRotateHandler, so I didn't add a test case.
document any changes to public APIs
N/A
post benchmark scores
manually test the debug page
I've only tested in on my Linux machine under Chrome and Firefox, specifically I can confirm that these all work:
Further details on my reasoning and approach:
The DragRotateHandler._keyUp method fires on a mouseup event so it can stop the
rotation/active state when you release the mouse button. However this
method also fires due to other interactions with the map such as
DragPan. So the _ignoreEvent method determines if the event mouseup or
other is to be ignored because it doesn't affect the DragRotateHandler.
This commit ensures that when the mouseup event happens on the left
mouse button without the Ctrl key pressed and DragRotate is still active
that the event is not ignored so that DragRotate can be deactivated.