Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix when it disappears when connecting an edge to update to a new node #1512

Merged
merged 1 commit into from
Oct 4, 2021
Merged

Fix when it disappears when connecting an edge to update to a new node #1512

merged 1 commit into from
Oct 4, 2021

Conversation

SeonghoJin
Copy link
Contributor

I am using the drag-and-drop function and Edge Update function by applying it to my project, but EdgeUpdate sometimes does not work well.

When I checked, it was not included in the dependencies of the useCallback functions that use onEdgeUpdate.

The onEdgeUpdate function code I used is

const [elements, setElements] = useState<Elements>(initialElements);
const onEdgeUpdate = (oldEdge: Edge, newConnection: Connection) =>
    setElements(updateEdge(oldEdge, newConnection, elements));

I think it's better to use the onEdgeUpdate Code from Example, but I hope this code works as well.

Below is a picture of edgeUpdate not working

Example

@moklick moklick merged commit 6ed16d6 into xyflow:main Oct 4, 2021
@moklick
Copy link
Member

moklick commented Oct 4, 2021

Thanks @SeonghoJin :)

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.

None yet

2 participants