plotly / plotly/react-plotly.js
`onSelected`: Keep default behavior of events
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.1k
- Forks
- 138
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 4
Description
Is there any way to keep the default behavior of events while providing a handler?
From what I understand from this post, unless the overridden function returns false the default behavior should be kept. However, when I provide an onSelected method the default behavior doesn't happen, no matter what the returned value is.
TBH, I'm not sure whether what I'm asking for is the expected behavior, but depending on the answer you can interpret this question as a feature request or a request for document clarification.
To make this more clear, what I see when onSelected is not provided is that the selected area stays active even after mouse is released and you can even select multiple regions like so:

However, when onSelected is provided, the selected region disappears after the mouse is released and I cannot reproduce the same behavior (at least not so easily).
To give you more context, my specific use-case here is to be able to download the information of the selected points using a separate button that I have created, so the default visual response works well for me.
Contributor guide
No contributing guide indexed for this repository
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
The issue does not name a source file, test, or entry point. Start by reproducing the difference between Plotly selection without an onSelected handler and with one, then compare the component's onSelected behavior with the linked Plotly event documentation. Done means either preserving the default selected-region visuals while handling the event or documenting the expected behavior clearly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- data-visualization, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100