File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
apps/sim/app/workspace/[workspaceId]/w/[workflowId] Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -2075,7 +2075,18 @@ const WorkflowContent = React.memo(() => {
20752075 ...node ,
20762076 selected : pendingSet . has ( node . id ) ,
20772077 } ) )
2078- setDisplayNodes ( resolveParentChildSelectionConflicts ( withSelection , blocks ) )
2078+ const resolved = resolveParentChildSelectionConflicts ( withSelection , blocks )
2079+ setDisplayNodes ( resolved )
2080+ const selectedIds = resolved . filter ( ( node ) => node . selected ) . map ( ( node ) => node . id )
2081+ const { currentBlockId, clearCurrentBlock, setCurrentBlockId } =
2082+ usePanelEditorStore . getState ( )
2083+ if ( selectedIds . length === 1 && selectedIds [ 0 ] !== currentBlockId ) {
2084+ setCurrentBlockId ( selectedIds [ 0 ] )
2085+ } else if ( selectedIds . length === 0 && currentBlockId ) {
2086+ clearCurrentBlock ( )
2087+ } else if ( selectedIds . length > 1 && currentBlockId ) {
2088+ clearCurrentBlock ( )
2089+ }
20792090 return
20802091 }
20812092
@@ -2181,6 +2192,8 @@ const WorkflowContent = React.memo(() => {
21812192 setCurrentBlockId ( selectedIds [ 0 ] )
21822193 } else if ( selectedIds . length === 0 && currentBlockId ) {
21832194 clearCurrentBlock ( )
2195+ } else if ( selectedIds . length > 1 && currentBlockId ) {
2196+ clearCurrentBlock ( )
21842197 }
21852198 }
21862199 } ,
You can’t perform that action at this time.
0 commit comments