File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
apps/sim/stores/workflows Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -541,17 +541,16 @@ export function regenerateBlockIds(
541541 const newNormalizedName = normalizeName ( newName )
542542 nameMap . set ( oldNormalizedName , newNormalizedName )
543543
544- const isNested = ! ! block . data ?. parentId
544+ // Always apply position offset and clear parentId since we paste to canvas level
545545 const newBlock : BlockState = {
546546 ...block ,
547547 id : newId ,
548548 name : newName ,
549- position : isNested
550- ? block . position
551- : {
552- x : block . position . x + positionOffset . x ,
553- y : block . position . y + positionOffset . y ,
554- } ,
549+ position : {
550+ x : block . position . x + positionOffset . x ,
551+ y : block . position . y + positionOffset . y ,
552+ } ,
553+ data : block . data ? { ...block . data , parentId : undefined } : block . data ,
555554 }
556555
557556 newBlocks [ newId ] = newBlock
You can’t perform that action at this time.
0 commit comments