File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
apps/sim/app/workspace/[workspaceId]/w/[workflowId] Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -1947,11 +1947,26 @@ const WorkflowContent = React.memo(() => {
19471947 const handleKeyUp = ( e : KeyboardEvent ) => {
19481948 if ( e . key === 'Shift' ) setIsShiftPressed ( false )
19491949 }
1950+ const handleFocusLoss = ( ) => {
1951+ setIsShiftPressed ( false )
1952+ setIsSelectionDragActive ( false )
1953+ }
1954+ const handleVisibilityChange = ( ) => {
1955+ if ( document . hidden ) {
1956+ handleFocusLoss ( )
1957+ }
1958+ }
1959+
19501960 window . addEventListener ( 'keydown' , handleKeyDown )
19511961 window . addEventListener ( 'keyup' , handleKeyUp )
1962+ window . addEventListener ( 'blur' , handleFocusLoss )
1963+ document . addEventListener ( 'visibilitychange' , handleVisibilityChange )
1964+
19521965 return ( ) => {
19531966 window . removeEventListener ( 'keydown' , handleKeyDown )
19541967 window . removeEventListener ( 'keyup' , handleKeyUp )
1968+ window . removeEventListener ( 'blur' , handleFocusLoss )
1969+ document . removeEventListener ( 'visibilitychange' , handleVisibilityChange )
19551970 }
19561971 } , [ ] )
19571972
You can’t perform that action at this time.
0 commit comments