onSelect prop for triggering selecting same node
See original GitHub issueWhen a node is selected, I trigger an information sidebar using onSelectionChange to open with details about that node. There is a button to close that sidebar. If closed, ReactFlow still considers that node selected, so selecting the same node previously selected does not trigger onSelectionChange and therefore I cannot trigger the sidebar to reopen. It would be nice to have onSelect which triggers every time so that this type of action could be supported.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Change <select>'s option and trigger events with JavaScript
For example using following code, if I change the option with my mouse then an event triggers (i.e. onchange is run).
Read more >Selection and Range - The Modern JavaScript Tutorial
JavaScript can access an existing selection, select/deselect DOM nodes as a whole or partially, remove the selected content from the document, ...
Read more >onselect Event - W3Schools
The onselect event occurs after some text has been selected in an element. The onselect event is mostly used on <input type="text"> or...
Read more >.select() | jQuery API Documentation
A function to execute each time the event is triggered. ... The method for retrieving the current selected text differs from one browser...
Read more >HTMLElement: change event - Web APIs | MDN
The change event is fired for <input> , <select> , and <textarea> elements ... like addEventListener() , or set an event handler property....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

At the moment you can only use the internal
setSelectedElementsaction mentioned in the comment by @sarasfive. When you press the close button you can reset the selection viasetSelectedElements([]). After that the selection should work as expected again.@pantchox Try to move the Provider one level up. I could imagine that your component isn’t wrapped.