File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
packages/core/src/composables Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @vue-flow/core " : patch
3+ ---
4+
5+ Only emit node position changes if a position change actually occurred.
Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ export function useDrag(params: UseDragParams) {
7474 let mousePosition : XYPosition = { x : 0 , y : 0 }
7575 let dragEvent : MouseEvent | null = null
7676 let dragStarted = false
77+ let nodePositionsChanged = false
7778
7879 let autoPanId = 0
7980 let autoPanStarted = false
@@ -104,6 +105,8 @@ export function useDrag(params: UseDragParams) {
104105 return n
105106 } )
106107
108+ nodePositionsChanged = nodePositionsChanged || hasChange
109+
107110 if ( ! hasChange ) {
108111 return
109112 }
@@ -187,6 +190,8 @@ export function useDrag(params: UseDragParams) {
187190 return
188191 }
189192
193+ nodePositionsChanged = false
194+
190195 if ( nodeDragThreshold . value === 0 ) {
191196 startDrag ( event , nodeEl )
192197 }
@@ -244,7 +249,10 @@ export function useDrag(params: UseDragParams) {
244249 }
245250
246251 if ( dragItems . length && ! isClick ) {
247- updateNodePositions ( dragItems , false , false )
252+ if ( nodePositionsChanged ) {
253+ updateNodePositions ( dragItems , false , false )
254+ nodePositionsChanged = false
255+ }
248256
249257 const [ currentNode , nodes ] = getEventHandlerParams ( {
250258 id,
You can’t perform that action at this time.
0 commit comments