-
-
Notifications
You must be signed in to change notification settings - Fork 210
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
When deleting a node, the neighboring edge deletes #291
Comments
Can you add a sandbox as well? That would be very helpful thank you :) |
Using your instructions doesn't yield the results you describe. As mentioned, please provide a sandbox reproduction please :) |
For some reason i have an error during running the sandbox, so i just created the repository and recorded the video. To create a node, just drag&drop it from the top pane |
Mh....I am using your repo and can't seem to be able to reproduce the issue as in your video. Screen.Recording.2022-10-04.at.16.02.10.movAre there any specific logs when the issue appears? |
Very strange. I'm on Chrome Version 106.0.5249.61 (Official Build) (64-bit) also tried on Firefox, and had the same issue. Also my colleague faced to the same issue |
I can't view the video you linked, can you link it in a different way? 😄 |
Also can you make sure that your browser isn't somehow overwriting the css rule for It needs to have the overflow rule
|
If you just open the video in the new tab, it doesn't show? :)) 3-rd video, i showed here elements list, and it seems edge really disapearing https://drive.google.com/file/d/1bl7xeJh-rqbzBMbrKaepwP3Y4j5sT1VR/view?usp=sharing |
Replace the following code: const {
onNodeDoubleClick,
onNodeClick,
onPaneClick,
onEdgeClick,
toObject,
onConnect,
addNodes,
addEdges,
getSelectedNodes,
applyEdgeChanges,
applyNodeChanges,
project
} = useVueFlow()
// ...
onNodeDoubleClick((e) => {
if (confirm('Delete node?')) {
applyNodeChanges([{type: 'remove', id: e.node.id}])
}
})
onEdgeClick((e) => {
if (confirm('Delete edge?')) {
applyEdgeChanges([{ type: 'remove', id: e.edge.id }])
}
}) with const {
onNodeDoubleClick,
onNodeClick,
onPaneClick,
onEdgeClick,
toObject,
onConnect,
addNodes,
addEdges,
getSelectedNodes,
removeEdges,
removeNodes,
project
} = useVueFlow()
onNodeDoubleClick((e) => {
if (confirm('Delete node?')) {
removeNodes([e.node])
}
})
onEdgeClick((e) => {
if (confirm('Delete edge?')) {
removeEdges([e.edge])
}
}) In most cases you should not be using What happens here is that you remove the node by applying the change yourself, thus Vue Flow never checks if any edges should be removed as well. Anyway, these issues don't appear when you use the actions instead :) |
@bcakmakoglu |
@insssomniac |
Issue tracker is ONLY used for reporting bugs.
New features should be discussed in the discussions.
Title
When deleting a node, the neighboring edge deletes also.
Expected Behavior
When you delete a node -- only edges, connected to it, should be deleted also.
Current Behavior
When deleting a node, the neighboring edge deletes also, but only visually. When you add new node or change something, it's appearing back.
Possible Solution
Steps to Reproduce
Context (Environment)
Detailed Description
Possible Implementation
The text was updated successfully, but these errors were encountered: