Skip to content

onContextMenu callback added#728

Merged
JadenHowell merged 4 commits intomainfrom
rightClick
Mar 11, 2026
Merged

onContextMenu callback added#728
JadenHowell merged 4 commits intomainfrom
rightClick

Conversation

@JadenHowell
Copy link
Contributor

Description

Adds the 'onContextMenu' prop, which is a callback that will fire when a chart is right clicked. The callback fires with the right click event and the nearest datum.

Motivation and Context

This enables consumers of React Spectrum Charts to allow for right clicking for more granular actions acting on specific data points, such as leaving a comment tied directly to a specified data point on a line chart.

How Has This Been Tested?

Verified by linking the build to my consuming application and testing right click. Also added 'onContextMenu' to line and bar stories associated with clicking, and added tests to verify callback fires.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@sonarqubecloud
Copy link

@github-actions
Copy link

@JadenHowell JadenHowell merged commit 936694c into main Mar 11, 2026
6 checks passed
@JadenHowell JadenHowell deleted the rightClick branch March 11, 2026 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants