Pane: only use cursor grab when panOnDrag=true
This commit is contained in:
@@ -220,7 +220,7 @@ export function Pane({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={cc(['react-flow__pane', { dragging, selection: isSelecting }])}
|
className={cc(['react-flow__pane', { draggable: panOnDrag, 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)}
|
||||||
|
|||||||
@@ -202,6 +202,7 @@
|
|||||||
<div
|
<div
|
||||||
bind:this={container}
|
bind:this={container}
|
||||||
class="svelte-flow__pane"
|
class="svelte-flow__pane"
|
||||||
|
class:draggable={panOnDrag}
|
||||||
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)}
|
||||||
|
|||||||
@@ -66,14 +66,17 @@
|
|||||||
|
|
||||||
.xy-flow__pane {
|
.xy-flow__pane {
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
cursor: grab;
|
|
||||||
|
|
||||||
&.selection {
|
&.selection {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.dragging {
|
&.draggable {
|
||||||
cursor: grabbing;
|
cursor: grab;
|
||||||
|
|
||||||
|
&.dragging {
|
||||||
|
cursor: grabbing;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user