Skip to content

Fix Firefox ctrl-click drag rotation#7456

Open
officialasishkumar wants to merge 2 commits intomaplibre:mainfrom
officialasishkumar:fix/firefox-ctrl-click-rotate
Open

Fix Firefox ctrl-click drag rotation#7456
officialasishkumar wants to merge 2 commits intomaplibre:mainfrom
officialasishkumar:fix/firefox-ctrl-click-rotate

Conversation

@officialasishkumar
Copy link
Copy Markdown

Fixes #6565

This updates mouse rotate gesture detection so Firefox/macOS Ctrl-click events, which arrive as right-button events with ctrlKey, can start drag rotation when camera roll is not enabled. When rollEnabled is enabled, Ctrl-right-click remains reserved for roll gestures.

Added coverage at both levels:

  • mouse handler classification for Firefox-shaped Ctrl-click events
  • map-level drag rotate regression for the same event shape
  • guard coverage that Ctrl-right-click still rolls, not rotates, when roll is enabled

Validation run locally:

  • npm run test-unit -- src/ui/handler/mouse_handler_interface.test.ts src/ui/handler/drag_rotate.test.ts
  • npm run lint -- src/ui/handler/mouse.ts src/ui/handler/mouse_handler_interface.test.ts src/ui/handler/drag_rotate.test.ts
  • npm run typecheck
  • npx cspell CHANGELOG.md

Launch Checklist

  • Confirm your changes do not include backports from Mapbox projects (unless with compliant license) - if you are not sure about this, please ask!
  • Briefly describe the changes in this PR.
  • Link to related issues.
  • Include before/after visuals or gifs if this PR includes visual changes. Not applicable; this is interaction behavior covered by tests.
  • Write tests for all new functionality.
  • Document any changes to public APIs. Not applicable; no public API changes.
  • Post benchmark scores. Not applicable; no rendering or performance-sensitive path changes.
  • Add an entry to CHANGELOG.md under the ## main section.

Treat Firefox's ctrl-click mouse events as rotate gestures when roll is disabled, while preserving ctrl-right roll behavior for maps that enable camera roll. Add unit and map-level regression coverage for the gesture classification.
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.50%. Comparing base (7f61f6f) to head (565e247).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7456      +/-   ##
==========================================
- Coverage   92.77%   92.50%   -0.28%     
==========================================
  Files         289      289              
  Lines       24017    24017              
  Branches     5100     5100              
==========================================
- Hits        22282    22217      -65     
- Misses       1735     1800      +65     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@HarelM
Copy link
Copy Markdown
Collaborator

HarelM commented Apr 13, 2026

Did you read the full issue thread and the closed PR?
Is this AI generated? If so please indicate which model did you use.

@HarelM HarelM added the need more info Further information is requested label Apr 13, 2026
@officialasishkumar
Copy link
Copy Markdown
Author

officialasishkumar commented Apr 13, 2026

Yes, I read the full issue thread and the closed PR. AI was used only for research and code auto completion

@HarelM
Copy link
Copy Markdown
Collaborator

HarelM commented Apr 13, 2026

I don't see how the fix is what's needed to solve this issue, can you please explain the solution (without the use of AI)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

need more info Further information is requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CTRL+Click Drag rotation not working on firefox

2 participants