xyflow / xyflow

React Flow | Svelte Flow - Powerful open source libraries for building node-based UIs with React (https://reactflow.dev) or Svelte (https://svelteflow.dev). Ready out-of-the-box and infinitely customizable.
https://xyflow.com
MIT License
22.07k stars 1.46k forks source link

Include 'deletable' property with EdgeProps and NodeProps #4269

Open TimmyTango opened 1 month ago

TimmyTango commented 1 month ago

Please describe the feature that you want to propose

The deletable property exists on Nodes and Edges, but isn't exposed to NodeProps and EdgeProps. This means you can't use the deletable property for conditional rendering for Node and Edge types.

In my specific case, I want to hide the delete icon I normally show on Edges in my EdgeType if deletable is false. I tried to access deletable anyway, hoping it was just at the type level, but it's always undefined.

As a workaround, I'm adding my own deletable property in my Edge's data property.

peterkogo commented 1 month ago

Thanks for bringing this up! That actually is a viable use case. I will open a PR for this.