@@ -355,6 +355,8 @@ export function AppShell({
355355 const [ devToolsVisible , setDevToolsVisible ] = useState ( ( ) =>
356356 readStoredFlag ( DEVTOOLS_VISIBLE_STORAGE_KEY , false ) ,
357357 ) ;
358+ const [ devToolsOverviewRequestKey , setDevToolsOverviewRequestKey ] =
359+ useState ( 0 ) ;
358360 const [ selectedUDID , setSelectedUDID ] = useState ( initialSelectedUDID ?? "" ) ;
359361 const [ search , setSearch ] = useState ( "" ) ;
360362 const openURLValueRef = useRef (
@@ -1748,6 +1750,17 @@ export function AppShell({
17481750 }
17491751 }
17501752
1753+ function prepareSimulatorInput ( ) {
1754+ setMenuOpen ( false ) ;
1755+ setAccessibilitySelectedId ( "" ) ;
1756+ setAccessibilityHoveredId ( null ) ;
1757+ window . getSelection ( ) ?. removeAllRanges ( ) ;
1758+ const activeElement = document . activeElement ;
1759+ if ( activeElement instanceof HTMLElement ) {
1760+ activeElement . blur ( ) ;
1761+ }
1762+ }
1763+
17511764 async function submitPairing ( event : FormEvent < HTMLFormElement > ) {
17521765 event . preventDefault ( ) ;
17531766 const code = pairingCode . trim ( ) ;
@@ -1842,6 +1855,7 @@ export function AppShell({
18421855 if ( ! selectedSimulator ) {
18431856 return ;
18441857 }
1858+ setDevToolsOverviewRequestKey ( ( current ) => current + 1 ) ;
18451859 setAccessibilitySelectedId ( "" ) ;
18461860 setAccessibilityHoveredId ( null ) ;
18471861 if ( ! sendControl ( selectedSimulator . udid , { type : "home" } ) ) {
@@ -2007,6 +2021,7 @@ export function AppShell({
20072021 setAccessibilityHoveredId ( null ) ;
20082022 setAccessibilityPickerActive ( false ) ;
20092023 } }
2024+ onSimulatorInteraction = { prepareSimulatorInput }
20102025 onScreenPointerCancel = { pointerInput . handleScreenPointerCancel }
20112026 onScreenPointerDown = { pointerInput . handleScreenPointerDown }
20122027 onScreenPointerMove = { pointerInput . handleScreenPointerMove }
@@ -2043,6 +2058,7 @@ export function AppShell({
20432058 devtoolsPanel = {
20442059 < DevToolsPanel
20452060 onClose = { ( ) => setDevToolsVisible ( false ) }
2061+ overviewRequestKey = { devToolsOverviewRequestKey }
20462062 selectedSimulator = { selectedSimulator }
20472063 visible = { devToolsVisible }
20482064 />
0 commit comments