question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Method `onElementsRemove` doesn't provide id of source handle if there're multiple ones

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
moklickcommented, Sep 16, 2020

I can’t reproduce the problem with the onElementClick handler. If you can’t solve it and you think there is a bug, please open a new issue. Thanks for the report 👍

1reaction
moklickcommented, Sep 14, 2020

Ah! I got it. Thanks for the hint. I will fix this.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found