@@ -165,10 +165,9 @@ onMounted(() => {
165165 const eventButton = (event as MouseEvent ).button
166166
167167 if (
168- (shouldPanOnDrag .value === true || (Array .isArray (shouldPanOnDrag .value ) && shouldPanOnDrag .value .includes (1 ))) &&
169168 eventButton === 1 &&
170169 event .type === ' mousedown' &&
171- ((event . target as HTMLElement )?. closest ( ' . vue-flow__node' ) || (event . target as HTMLElement )?. closest ( ' . vue-flow__edge' ))
170+ (isWrappedWithClass (event , ' vue-flow__node' ) || isWrappedWithClass (event , ' vue-flow__edge' ))
172171 ) {
173172 return true
174173 }
@@ -228,22 +227,22 @@ onMounted(() => {
228227
229228 // if the pane is only movable using allowed clicks
230229 if (
231- Array .isArray (shouldPanOnDrag .value ) &&
232- ! shouldPanOnDrag .value .includes (eventButton ) &&
230+ Array .isArray (panOnDrag .value ) &&
231+ ! panOnDrag .value .includes (eventButton ) &&
233232 (event .type === ' mousedown' || event .type === ' touchstart' )
234233 ) {
235234 return false
236235 }
237236
238237 // We only allow right clicks if pan on drag is set to right-click
239238 const buttonAllowed =
240- (Array .isArray (shouldPanOnDrag .value ) && shouldPanOnDrag .value .includes (eventButton )) ||
241- (selectionKeyCode .value === true && Array .isArray (shouldPanOnDrag .value ) && ! shouldPanOnDrag .value .includes (0 )) ||
239+ (Array .isArray (panOnDrag .value ) && panOnDrag .value .includes (eventButton )) ||
240+ (selectionKeyCode .value === true && Array .isArray (panOnDrag .value ) && ! panOnDrag .value .includes (0 )) ||
242241 ! eventButton ||
243242 eventButton <= 1
244243
245244 // default filter for d3-zoom
246- return (! event .ctrlKey || event .type === ' wheel' ) && buttonAllowed
245+ return (! event .ctrlKey || panKeyPressed . value || event .type === ' wheel' ) && buttonAllowed
247246 })
248247
249248 watch (
@@ -293,7 +292,7 @@ onMounted(() => {
293292 const _isMacOs = isMacOs ()
294293
295294 // macOS sets ctrlKey=true for pinch gesture on a trackpad
296- if (event .ctrlKey && zoomOnPinch .value && _isMacOs ) {
295+ if (! panKeyPressed . value && event .ctrlKey && zoomOnPinch .value && _isMacOs ) {
297296 const point = pointer (event )
298297 const pinchDelta = wheelDelta (event )
299298 const zoom = currentZoom * 2 ** pinchDelta
0 commit comments