You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to implement a "group" block type which automatically moves blocks with it that are visually inside it. For that, I use parentId, intersection detection methods, and adjust positions to account relative position when using parentId, though updateNodeData.
The problem: changing the position of the node does not work if set alongside the parentId. (This is very visible with the custom node in the stackblitz demo.)
👉 Not changing parentId allows the updateNodeData method to set new positions. Additionally dirty hacks like splitting updateNodeData, using tick() or two do not work. It looks like there is an event ordering issue in Svelteflow that resets changes to nodes' position with parentIdafter the onnodedragstop.
Steps to reproduce the bug or issue
Open the demo
Drag the group node onto the custom node
Observe that the coordinates of the custom node did not change despite the code that readjusts its position to relative coordinates.
Dragging the node again makes it jump unpredictably.
Expected behavior
There should be a way to make dynamic parentId assignment work without special shenanigans and coordinate jumps. Setting parentId and new position must work.
Screenshots or Videos
(Putting a node into a group / putting a group over nodes produces same results)
What platform were you using when you found the bug?
Live code example
https://stackblitz.com/edit/svelte-flow-ts-p1v4ceyf?file=src%2FFlow%2Findex.svelte
Describe the Bug
I would like to implement a "group" block type which automatically moves blocks with it that are visually inside it. For that, I use
parentId, intersection detection methods, and adjust positions to account relative position when usingparentId, thoughupdateNodeData.The problem: changing the
positionof the node does not work if set alongside theparentId. (This is very visible with the custom node in the stackblitz demo.)👉 Not changing
parentIdallows theupdateNodeDatamethod to set newpositions. Additionally dirty hacks like splittingupdateNodeData, usingtick()or two do not work. It looks like there is an event ordering issue in Svelteflow that resets changes to nodes' position withparentIdafter theonnodedragstop.Steps to reproduce the bug or issue
Expected behavior
There should be a way to make dynamic parentId assignment work without special shenanigans and coordinate jumps. Setting parentId and new position must work.
Screenshots or Videos
(Putting a node into a group / putting a group over nodes produces same results)
_20260606_182818.mp4
Additional context
No response