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) {
74
74
let mousePosition : XYPosition = { x : 0 , y : 0 }
75
75
let dragEvent : MouseEvent | null = null
76
76
let dragStarted = false
77
+ let nodePositionsChanged = false
77
78
78
79
let autoPanId = 0
79
80
let autoPanStarted = false
@@ -104,6 +105,8 @@ export function useDrag(params: UseDragParams) {
104
105
return n
105
106
} )
106
107
108
+ nodePositionsChanged = nodePositionsChanged || hasChange
109
+
107
110
if ( ! hasChange ) {
108
111
return
109
112
}
@@ -187,6 +190,8 @@ export function useDrag(params: UseDragParams) {
187
190
return
188
191
}
189
192
193
+ nodePositionsChanged = false
194
+
190
195
if ( nodeDragThreshold . value === 0 ) {
191
196
startDrag ( event , nodeEl )
192
197
}
@@ -244,7 +249,10 @@ export function useDrag(params: UseDragParams) {
244
249
}
245
250
246
251
if ( dragItems . length && ! isClick ) {
247
- updateNodePositions ( dragItems , false , false )
252
+ if ( nodePositionsChanged ) {
253
+ updateNodePositions ( dragItems , false , false )
254
+ nodePositionsChanged = false
255
+ }
248
256
249
257
const [ currentNode , nodes ] = getEventHandlerParams ( {
250
258
id,
You can’t perform that action at this time.
0 commit comments