feat: add a selectBoxOnDrag prop which allows select box to be triggered without an additional key press.

This commit is contained in:
Jack Fishwick
2022-11-22 10:55:06 +00:00
parent 6bbc004315
commit 685ff76ee8
5 changed files with 19 additions and 10 deletions
@@ -44,6 +44,7 @@ const FlowRenderer = ({
onMoveStart,
onMoveEnd,
selectionKeyCode,
selectBoxOnDrag,
multiSelectionKeyCode,
zoomActivationKeyCode,
elementsSelectable,
@@ -84,7 +85,6 @@ const FlowRenderer = ({
onMove={onMove}
onMoveStart={onMoveStart}
onMoveEnd={onMoveEnd}
selectionKeyPressed={selectionKeyPressed}
elementsSelectable={elementsSelectable}
zoomOnScroll={zoomOnScroll}
zoomOnPinch={zoomOnPinch}
@@ -103,7 +103,7 @@ const FlowRenderer = ({
noPanClassName={noPanClassName}
>
{children}
<UserSelection selectionKeyPressed={selectionKeyPressed} />
<UserSelection selectionKeyPressed={selectionKeyPressed || (selectBoxOnDrag && !panOnDrag)} />
{nodesSelectionActive && (
<NodesSelection
onSelectionContextMenu={onSelectionContextMenu}