feat: handle selection mode properly. Up z-index for selection box.

This commit is contained in:
Jack Fishwick
2022-11-22 10:55:06 +00:00
parent 45c407755f
commit 55811169da
4 changed files with 38 additions and 38 deletions
@@ -69,6 +69,8 @@ const FlowRenderer = ({
const nodesSelectionActive = useStore(selector);
const selectionKeyPressed = useKeyPress(selectionKeyCode);
const isSelectionMode = selectionKeyPressed || selectBoxOnDrag;
useGlobalKeyHandler({ deleteKeyCode, multiSelectionKeyCode });
const onClick = (event: MouseEvent) => {
@@ -92,7 +94,7 @@ const FlowRenderer = ({
panOnScrollSpeed={panOnScrollSpeed}
panOnScrollMode={panOnScrollMode}
zoomOnDoubleClick={zoomOnDoubleClick}
panOnDrag={panOnDrag}
panOnDrag={panOnDrag && !isSelectionMode}
defaultViewport={defaultViewport}
translateExtent={translateExtent}
minZoom={minZoom}
@@ -109,7 +111,7 @@ const FlowRenderer = ({
onMouseLeave={onPaneMouseLeave}
onContextMenu={onContextMenu}
onWheel={onWheel}
selectionKeyPressed={selectionKeyPressed || (selectBoxOnDrag && !panOnDrag)}
selectionKeyPressed={isSelectionMode}
>
{children}
{nodesSelectionActive && (