Comments (2)
@mcmxcdev You can just return true
inside the onbeforedelete
handler so the elements get deleted (false if deletion has not been confirmed). There is no need to actually programmatically delete the elements.
However, I still see you point. I assume there might be a reason to delete those elements programmatically, or to simply distinguish what has triggered the deletion (user input vs. program).
What do you think about an optional force
parameter for deleteElements
that skips onbeforedelete
?
from xyflow.
It's not that we trigger an async request in onbeforedelete
that needs to be awaited until it can be deleted. It's a modal window that might or might not confirm the deletion. So we are taken completely out of the flow of onbeforedelete
, hence we need programatical deletion.
However, I still see you point. I assume there might be a reason to delete those elements programmatically, or to simply distinguish what has triggered the deletion (user input vs. program).
Yes, 100%
What do you think about an optional force parameter for deleteElements that skips onbeforedelete?
That would sound reasonable to fix the issue I am experiencing, but other users might run into situations where they would need event
exposed for other use cases, so I would still consider that important.
from xyflow.
Related Issues (20)
- [SvelteFlow] Bad performance in svelte-5 HOT 1
- [Docs] Add Bun
- Node creation by click and draw / drag HOT 5
- [SvelteFlow] Node internals not updating dynamic handles correctly HOT 1
- Copy & Paste issue HOT 2
- Warning: Each child in a list should have a unique "key" prop. HOT 2
- Support key combinations for selection, pan and zoom HOT 1
- `Handle` is supposed to accept `isValidConnection` prop but it is not supported HOT 1
- `Minimap` cannot be interacted with on a touch device HOT 7
- onDrag node param has previous position with grid and snapToGrip enabled HOT 4
- Unable to render all the nodes and edges HOT 1
- updateNodeData does not run consistently in 12.0.0-next.12, next.13, next.14 HOT 5
- 90% GPU utilization for animated edges HOT 2
- Edges not rendering with production build. HOT 5
- Get relative node position on Edge Drop for new node with parentNode HOT 1
- It is not possible to call 'layout' with 'useNodesInitialized()' and controlled flow HOT 3
- Select text inside node: chrome bug for transformed elements HOT 3
- [React flow] Flickering / z-fighting / re-rendering between canvas & nodes on click/drag, introduced in 11.10.4 HOT 1
- [SvelteFlow] Nodes with unchanged IDs becoming invisible in SvelteFlow 0.0.40 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xyflow.