Method `onElementsRemove` doesn't provide id of source handle if there're multiple ones
See original GitHub issueI have node with 1 input handle & multiple subnodes (each subnode has 1 output handle). The application state looks like this:
nodes: [
{
id: 'node1',
data: {
subnodes: [
{ id: 'subnode1' },
...
]
}
},
{
id: 'node2',
data: {}
}
],
edges: [
{
id: 'edge1',
source: 'node1__subnode1',
target: 'node2'
}
]
Output handle of each subnode uses the id of its subnode.
When I try to delete the edge edge1 by pressing Backspace, which triggers onElementsRemove, I find out that source of the removed edge is node1 (it should be node1__subnode1), so I can’t detect which subnode the source was.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
React Flow: How to remove an element? - Stack Overflow
I was able to accomplish the end result I wanted by creating this function: const deleteNode = (id) => { setElements((els) ...
Read more >Migrate to v10 Guide - React Flow
Migrate to v10. Welcome to React Flow v10! With the major version update, there are coming many new features but also some breaking...
Read more >This version has been deprecated - react-flow-renderer - npm
If you have multiple source or target handles you need to pass an id to these handles. These ids get then added to...
Read more >React Flow - A Library for Rendering Interactive Graphs - webkid
We just open sourced "React Flow" : A library for rendering interactive node-based graphs with a smooth panning and zooming behaviour and…
Read more >Delete your verification data - Google Account Help
Your verification data is automatically deleted once your channel history is established. This can take a few months or up to 2 years....
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

I can’t reproduce the problem with the
onElementClickhandler. If you can’t solve it and you think there is a bug, please open a new issue. Thanks for the report 👍Ah! I got it. Thanks for the hint. I will fix this.