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 Oct 9, 2023
1 parent 619aee6 commit a9f71a4
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,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 parentAction = ReportActionsUtils.getParentReportAction(report);
const shouldAutoFocus = !modal.isVisible && (shouldFocusInputOnScreenFocus || (isEmptyChat && !ReportActionsUtils.isTransactionThread(parentAction))) && shouldShowComposeInput;

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

0 comments on commit a9f71a4

Please sign in to comment.