Comments (3)
it seems that the codesandbox is private
from xyflow.
Sorry, I have made it public. Please have a look.
from xyflow.
I got it now. The behaviour is correct. When you drag a node out of its parent and add it to a new parent, you need to adjust the position based on the pointer position and the new parent position.
pseudo code:
nodePosition = screenToFlowPosition(event) - newParentNodePosition
![Screenshot 2024-02-29 at 17 38 32](https://private-user-images.githubusercontent.com/2857535/309002526-3d104585-48d8-4a4d-97e6-1ebd41e1f6ce.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkwMzY2ODQsIm5iZiI6MTcxOTAzNjM4NCwicGF0aCI6Ii8yODU3NTM1LzMwOTAwMjUyNi0zZDEwNDU4NS00OGQ4LTRhNGQtOTdlNi0xZWJkNDFlMWY2Y2UucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYyMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MjJUMDYwNjI0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YWNmYTk2NWYzNTdhNTk3MjE4MTY3Y2UzMTZjZDlhZjZiODdjMGYwNDU4OTM5NWVlYzNmYmUyNzFlYTNkYmZkMyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.ce_U1nj4OaHRxgvPzXbPOPq9yB2FINLOdxGCYqFwgNI)
from xyflow.
Related Issues (20)
- Source and Target handle getting null HOT 5
- Working Reactflow, when i add a Panel it errors HOT 1
- Drag problem after changing parentNode HOT 1
- SvelteFlow: Copy/Paste (continued issue) HOT 1
- Be able to pan the viewport on right mouse click on Node. HOT 6
- Disable node drag on multitouch HOT 3
- Remove pointer events from Pane if user selection active HOT 1
- Not possible to deselect edges HOT 1
- Edges not initially rendered onlyRenderVisibleElements is set and connecting offscreen node has height set HOT 1
- @types packages should be devDependencies HOT 1
- In SvelteFlow, setting viewport on initialization gets overridden on pan HOT 1
- Dynamic edge label updates not working HOT 1
- Rename `updateEdge` to `reconnectEdge` HOT 5
- Using Jest to click on handle throws "S?.elementFromPoint is not a function" error HOT 5
- when draggin a node it leave a trail
- [React Flow]: Couldn't create edge for target handle id HOT 1
- Uncaught TypeError: Cannot read properties of null (reading 'useRef') HOT 1
- No flow in sight since v11 migration HOT 8
- edge mouse enter and edge mouse leave not working HOT 4
- `addNodes` blocked by `setNodes` HOT 4
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.