@@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
'@xyflow/react': patch
|
||||||
|
'@xyflow/svelte': patch
|
||||||
|
'@xyflow/system': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Only display grab cursor when panOnDrag is on left mouse button
|
||||||
@@ -253,9 +253,11 @@ export function Pane({
|
|||||||
selectionStarted.current = false;
|
selectionStarted.current = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const draggable = panOnDrag === true || (Array.isArray(panOnDrag) && panOnDrag.includes(0));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={cc(['react-flow__pane', { draggable: panOnDrag, dragging, selection: isSelecting }])}
|
className={cc(['react-flow__pane', { draggable, dragging, selection: isSelecting }])}
|
||||||
onClick={hasActiveSelection ? undefined : wrapHandler(onClick, container)}
|
onClick={hasActiveSelection ? undefined : wrapHandler(onClick, container)}
|
||||||
onContextMenu={wrapHandler(onContextMenu, container)}
|
onContextMenu={wrapHandler(onContextMenu, container)}
|
||||||
onWheel={wrapHandler(onWheel, container)}
|
onWheel={wrapHandler(onWheel, container)}
|
||||||
|
|||||||
@@ -212,7 +212,7 @@
|
|||||||
<div
|
<div
|
||||||
bind:this={container}
|
bind:this={container}
|
||||||
class="svelte-flow__pane"
|
class="svelte-flow__pane"
|
||||||
class:draggable={panOnDrag}
|
class:draggable={panOnDrag === true || (Array.isArray(panOnDrag) && panOnDrag.includes(0))}
|
||||||
class:dragging={$dragging}
|
class:dragging={$dragging}
|
||||||
class:selection={isSelecting}
|
class:selection={isSelecting}
|
||||||
on:click={hasActiveSelection ? undefined : wrapHandler(onClick, container)}
|
on:click={hasActiveSelection ? undefined : wrapHandler(onClick, container)}
|
||||||
|
|||||||
@@ -75,10 +75,10 @@
|
|||||||
|
|
||||||
&.draggable {
|
&.draggable {
|
||||||
cursor: grab;
|
cursor: grab;
|
||||||
|
}
|
||||||
|
|
||||||
&.dragging {
|
&.dragging {
|
||||||
cursor: grabbing;
|
cursor: grabbing;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user