@@ -1939,7 +1939,6 @@ const WorkflowContent = React.memo(() => {
19391939 }
19401940 const handleFocusLoss = ( ) => {
19411941 setIsShiftPressed ( false )
1942- setIsSelectionDragActive ( false )
19431942 }
19441943 const handleVisibilityChange = ( ) => {
19451944 if ( document . hidden ) {
@@ -2858,20 +2857,6 @@ const WorkflowContent = React.memo(() => {
28582857 ]
28592858 )
28602859
2861- // Lock selection mode when selection drag starts (captures Shift state at drag start)
2862- const onSelectionStart = useCallback ( ( ) => {
2863- if ( isShiftPressed ) {
2864- setIsSelectionDragActive ( true )
2865- }
2866- } , [ isShiftPressed ] )
2867-
2868- const onSelectionEnd = useCallback ( ( ) => {
2869- requestAnimationFrame ( ( ) => {
2870- setIsSelectionDragActive ( false )
2871- setDisplayNodes ( ( nodes ) => resolveParentChildSelectionConflicts ( nodes , blocks ) )
2872- } )
2873- } , [ blocks ] )
2874-
28752860 /** Captures initial positions when selection drag starts (for marquee-selected nodes). */
28762861 const onSelectionDragStart = useCallback (
28772862 ( _event : React . MouseEvent , nodes : Node [ ] ) => {
@@ -3334,9 +3319,9 @@ const WorkflowContent = React.memo(() => {
33343319 edgeTypes = { edgeTypes }
33353320 onDrop = { effectivePermissions . canEdit ? onDrop : undefined }
33363321 onDragOver = { effectivePermissions . canEdit ? onDragOver : undefined }
3337- onInit = { ( ) => {
3322+ onInit = { ( instance ) => {
33383323 requestAnimationFrame ( ( ) => {
3339- fitViewToBounds ( { padding : 0.1 , maxZoom : 1.0 } )
3324+ instance . fitView ( reactFlowFitViewOptions )
33403325 setIsCanvasReady ( true )
33413326 } )
33423327 } }
@@ -3357,11 +3342,9 @@ const WorkflowContent = React.memo(() => {
33573342 onPointerMove = { handleCanvasPointerMove }
33583343 onPointerLeave = { handleCanvasPointerLeave }
33593344 elementsSelectable = { true }
3360- selectionOnDrag = { ! isHandMode || isSelectionDragActive }
3345+ selectionOnDrag = { ! isHandMode }
33613346 selectionMode = { SelectionMode . Partial }
33623347 panOnDrag = { isHandMode ? [ 0 , 1 ] : false }
3363- onSelectionStart = { onSelectionStart }
3364- onSelectionEnd = { onSelectionEnd }
33653348 multiSelectionKeyCode = { [ 'Meta' , 'Control' , 'Shift' ] }
33663349 nodesConnectable = { effectivePermissions . canEdit }
33673350 nodesDraggable = { effectivePermissions . canEdit }
0 commit comments