visgl / visgl/deck.gl

[Bug] Right-click recognition isn't working on Safari

Open
#8,410 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.