Skip to content

Commit 6620d4b

Browse files
authored
Merge pull request Expensify#65229 from bernhardoj/fix/64065-composer-not-refocused-after-add-emoji
Fix composer is not refocused after adding an emoji in edit composer
2 parents 868c27e + cb21552 commit 6620d4b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/libs/ReportActionComposeFocusManager.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
import {findFocusedRoute} from '@react-navigation/native';
22
import React from 'react';
3-
import type {MutableRefObject} from 'react';
3+
import type {RefObject} from 'react';
44
import type {TextInput} from 'react-native';
55
import SCREENS from '@src/SCREENS';
66
import isReportOpenInRHP from './Navigation/helpers/isReportOpenInRHP';
77
import navigationRef from './Navigation/navigationRef';
88

99
type 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
1818
let 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

Comments
 (0)