mapbox / mapbox/mapbox-gl-js

Map rotation/pitch not performed on rapid successive right clicks

Open
#12,816 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug :lady_beetle:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

**mapbox-gl-js version**: v2.15.0

**browser**: Chrome Version 114.0.5735.199

**OS**: Windows 11 Pro 22H2 22621.1992

### Steps to Trigger Behavior

1. Start rotating the map
2. Quickly let go of RMB and start another rotation by RMB
3. Rotation/pitch are not performed, although RMB is held down and the mouse is moving

### Link to Demonstration

https://jsfiddle.net/6sdht8je/3/
Demo:

https://github.com/mapbox/mapbox-gl-js/assets/11539004/370d12b7-70c4-4d43-b4f0-325eabd65864

### Expected Behavior
Rotation/pitch continues and follows mouse movements.

### Actual Behavior
Rotation/pitch is stopped until the RMB is let go.

#### Notes
As you may see on the recording, this doesn't always trigger. The event console logs may indicate the reason behind this behavior: the rotate/pitch end events get triggered regardless of the mousedown event not being directly followed by a mouseup event.
![image](https://github.com/mapbox/mapbox-gl-js/assets/11539004/440ac21a-59c6-4a1d-ba8b-5d334293fd96)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the rapid right-click sequence in the linked JSFiddle and compare the event console logs, especially the rotate/pitch end events. Confirm the fix by repeating the sequence and verifying that rotation and pitch continue while RMB is held and the mouse moves.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.