11import { findFocusedRoute } from '@react-navigation/native' ;
22import React from 'react' ;
3- import type { MutableRefObject } from 'react' ;
3+ import type { RefObject } from 'react' ;
44import type { TextInput } from 'react-native' ;
55import SCREENS from '@src/SCREENS' ;
66import isReportOpenInRHP from './Navigation/helpers/isReportOpenInRHP' ;
77import navigationRef from './Navigation/navigationRef' ;
88
99type FocusCallback = ( shouldFocusForNonBlurInputOnTapOutside ?: boolean ) => void ;
1010
11- const composerRef : MutableRefObject < TextInput | null > = React . createRef < TextInput > ( ) ;
11+ const composerRef : RefObject < TextInput | null > = React . createRef < TextInput > ( ) ;
1212
1313// There are two types of composer: general composer (edit composer) and main composer.
1414// The general composer callback will take priority if it exists.
15- const editComposerRef : MutableRefObject < TextInput | null > = React . createRef < TextInput > ( ) ;
15+ const editComposerRef : RefObject < TextInput | null > = React . createRef < TextInput > ( ) ;
1616// There are two types of focus callbacks: priority and general
1717// Priority callback would take priority if it existed
1818let priorityFocusCallback : FocusCallback | null = null ;
@@ -39,7 +39,7 @@ function focus(shouldFocusForNonBlurInputOnTapOutside?: boolean) {
3939 /** Do not trigger the refocusing when the active route is not the report screen */
4040 const navigationState = navigationRef . getState ( ) ;
4141 const focusedRoute = findFocusedRoute ( navigationState ) ;
42- if ( ! navigationState || ( ! isReportOpenInRHP ( navigationState ) && focusedRoute ?. name !== SCREENS . REPORT ) ) {
42+ if ( ! navigationState || ( ! isReportOpenInRHP ( navigationState ) && focusedRoute ?. name !== SCREENS . REPORT && focusedRoute ?. name !== SCREENS . SEARCH . MONEY_REQUEST_REPORT ) ) {
4343 return ;
4444 }
4545
0 commit comments