Skip to content

Commit

Permalink
prevent auto focus for transaction thread empty chat
Browse files Browse the repository at this point in the history
  • Loading branch information
Pujan92 committed Sep 7, 2023
1 parent db1a306 commit 24d9957
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ function ComposerWithSuggestions({
const maxComposerLines = isSmallScreenWidth ? CONST.COMPOSER.MAX_LINES_SMALL_SCREEN : CONST.COMPOSER.MAX_LINES;

const isEmptyChat = useMemo(() => _.size(reportActions) === 1, [reportActions]);
const shouldAutoFocus = !modal.isVisible && (shouldFocusInputOnScreenFocus || isEmptyChat) && shouldShowComposeInput;
const parentReportAction = ReportActionsUtils.getParentReportAction(report);
const shouldAutoFocus = !modal.isVisible && (shouldFocusInputOnScreenFocus || (isEmptyChat && !ReportActionsUtils.isTransactionThread(parentReportAction))) && shouldShowComposeInput;

const valueRef = useRef(value);
valueRef.current = value;
Expand Down

0 comments on commit 24d9957

Please sign in to comment.