[Bug] Right-click recognition isn't working on Safari
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 14.6k
- Forks
- 2.3k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 42
Description
Description
Attaching onClick to DeckGL component doesn't recognise right-clicks as right-clicks on Safari. They're passed as left-clicks, instead.
Here's a Codepen example that illustrates the issue:
https://codepen.io/henrikaalto/pen/oNVBVjX?editors=0010
It works fine on Chrome and Firefox.
Flavors
- Script tag
- React
- Python/Jupyter notebook
- MapboxOverlay
- GoogleMapsOverlay
- CartoLayer
- ArcGIS
Expected Behavior
I expect a window.alert to pop up when I right-click the map.
Steps to Reproduce
Open Codepen on Safari and right-click on the map.
Alternatively, add onClick handler to DeckGL component and notice that left-clicks and right-clicks look identical.
Environment
- Framework version: deck.gl@latest
- Browser: Safari 17.2.1 (19617.1.17.11.12), Chrome 120.0.6099.216, Firefox 121.0.1
- OS: MacOS 14.2.1 (23C71)
Logs
No errors appear.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the CodePen example in Safari and trace the DeckGL component's onClick event entry point. Compare the right-click event behavior with Chrome and Firefox; done means Safari distinguishes right-clicks from left-clicks and the expected window.alert appears.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- data-visualization, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100