Disable selection deleting #375
-
Hello, Is there an option to disable deleting of selected nodes? While digging through the docs and playing around, I see that I could create a read-only flow by disabling some functionality (drag and drop, etc). I hoped to still allow selection for highlighting certain portions and where the edges run, but selections are deletable. The only related option I see is for setting the Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
There's a couple of ways to prevent elements being deleted.
Here's a sandbox with these options enabled: https://codesandbox.io/s/keen-hypatia-su4voj?file=/src/App.vue:926-950 |
Beta Was this translation helpful? Give feedback.
-
Is there any way to do this with the options api? |
Beta Was this translation helpful? Give feedback.
-
Oh thank you! |
Beta Was this translation helpful? Give feedback.
There's a couple of ways to prevent elements being deleted.
Here are two simple ways of going about it.
deleteKeyCode
to falseBackspace
or whatever key you'd like - a cb function is also allowed.applyDefault
to falseapplyDefault
to false you disable the default change handlers, i.e. no more changes are processedapplyNodeChanges
orapplyEdgeChanges