Skip to content

Commit

Permalink
changed variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
FitseTLT committed Apr 5, 2024
1 parent 335b5fa commit 6fd4517
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/libs/ReportActionComposeFocusManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type {TextInput} from 'react-native';
import ROUTES from '@src/ROUTES';
import Navigation from './Navigation/Navigation';

type FocusCallback = (shouldFocusForNative?: boolean) => void;
type FocusCallback = (shouldFocusForNonBlurInputOnTapOutside?: boolean) => void;

const composerRef = React.createRef<TextInput>();
const editComposerRef = React.createRef<TextInput>();
Expand All @@ -29,7 +29,7 @@ function onComposerFocus(callback: FocusCallback | null, isMainComposer = false)
/**
* Request focus on the ReportActionComposer
*/
function focus(shouldFocusForNative?: boolean) {
function focus(shouldFocusForNonBlurInputOnTapOutside?: boolean) {
/** Do not trigger the refocusing when the active route is not the report route, */
if (!Navigation.isActiveRoute(ROUTES.REPORT_WITH_ID.getRoute(Navigation.getTopmostReportId() ?? ''))) {
return;
Expand All @@ -40,7 +40,7 @@ function focus(shouldFocusForNative?: boolean) {
return;
}

mainComposerFocusCallback(shouldFocusForNative);
mainComposerFocusCallback(shouldFocusForNonBlurInputOnTapOutside);
return;
}

Expand Down
4 changes: 2 additions & 2 deletions src/pages/home/report/ContextMenu/ContextMenuActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ const ContextMenuActions: ContextMenuAction[] = [
if (closePopover) {
hideContextMenu(false, () => {
InteractionManager.runAfterInteractions(() => {
// Normally the focus callback of the main composer doesn't focus for natives,
// so we need to pass true here to allow focusing for natives too.
// Normally the focus callback of the main composer doesn't focus when willBlurTextInputOnTapOutside
// is false, so we need to pass true here to override this condition.
ReportActionComposeFocusManager.focus(true);
});
Report.navigateToAndOpenChildReport(reportAction?.childReportID ?? '0', reportAction, reportID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -591,8 +591,8 @@ function ComposerWithSuggestions(

const setUpComposeFocusManager = useCallback(() => {
// This callback is used in the contextMenuActions to manage giving focus back to the compose input.
ReportActionComposeFocusManager.onComposerFocus((shouldFocusForNative = false) => {
if ((!willBlurTextInputOnTapOutside && !shouldFocusForNative) || !isFocused) {
ReportActionComposeFocusManager.onComposerFocus((shouldFocusForNonBlurInputOnTapOutside = false) => {
if ((!willBlurTextInputOnTapOutside && !shouldFocusForNonBlurInputOnTapOutside) || !isFocused) {
return;
}

Expand Down

0 comments on commit 6fd4517

Please sign in to comment.