Prevent all workflow node and edge deletions made through the UI (#9918)

## Old

In the demo, I press the `Delete` key multiple times, and it deletes the
nodes.


https://github.com/user-attachments/assets/75bf84d3-b182-488c-a781-bbe236985142

## New


https://github.com/user-attachments/assets/4ae4f387-e143-4ce8-8140-6cb2c549f5d2
This commit is contained in:
Baptiste Devessier
2025-01-29 18:29:01 +01:00
committed by GitHub
parent ce296fae4f
commit 85df6ada52
2 changed files with 36 additions and 0 deletions

View File

@ -227,6 +227,10 @@ export const WorkflowDiagramCanvasBase = ({
edges={edges}
onNodesChange={handleNodesChange}
onEdgesChange={handleEdgesChange}
onBeforeDelete={async () => {
// Abort all non-programmatic deletions
return false;
}}
proOptions={{ hideAttribution: true }}
multiSelectionKeyCode={null}
nodesFocusable={false}