From c2d94885fbd9bcf434fbec8b6dde6a5a3e1f6223 Mon Sep 17 00:00:00 2001 From: Alex Beaman Date: Mon, 30 Dec 2024 14:51:01 +0200 Subject: [PATCH] Merge pull request #54651 from christianwen/fix/54629 Composer is blocked by keyboard after changing payment method or backgrounding app (cherry picked from commit 5555a4278cabe8b34594735464581e7190217440) (CP triggered by Beamanator) --- .../ComposerWithSuggestions/ComposerWithSuggestions.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx b/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx index b56109b64c40..f437b0395971 100644 --- a/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx +++ b/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx @@ -648,6 +648,13 @@ function ComposerWithSuggestions( focus(true); }, [focus, prevIsFocused, editFocused, prevIsModalVisible, isFocused, modal?.isVisible, isNextModalWillOpenRef, shouldAutoFocus]); + useEffect(() => { + if (prevIsFocused || !isFocused || showSoftInputOnFocus) { + return; + } + setShowSoftInputOnFocus(true); + }, [isFocused, prevIsFocused, showSoftInputOnFocus, setShowSoftInputOnFocus]); + useEffect(() => { // Scrolls the composer to the bottom and sets the selection to the end, so that longer drafts are easier to edit updateMultilineInputRange(textInputRef.current, !!shouldAutoFocus);