diff --git a/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions.js b/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions.js index 45882dc23a78..6a29c5b6cfef 100644 --- a/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions.js +++ b/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions.js @@ -354,9 +354,10 @@ function ComposerWithSuggestions({ * @returns {Boolean} */ const checkComposerVisibility = useCallback(() => { - const isComposerCoveredUp = EmojiPickerActions.isEmojiPickerVisible() || isMenuVisible || modal.isVisible; + // Checking whether the screen is focused or not, helps avoid `modal.isVisible` false when popups are closed, even if the modal is opened. + const isComposerCoveredUp = !isFocused || EmojiPickerActions.isEmojiPickerVisible() || isMenuVisible || modal.isVisible || modal.willAlertModalBecomeVisible; return !isComposerCoveredUp; - }, [isMenuVisible, modal.isVisible]); + }, [isMenuVisible, modal, isFocused]); const focusComposerOnKeyPress = useCallback( (e) => {