Skip to content

Commit

Permalink
Merge pull request #26826 from b4s36t4/fix/composer-focus-after-popups
Browse files Browse the repository at this point in the history
fix composer focusing for popups
  • Loading branch information
MariaHCD authored Sep 12, 2023
2 parents 754e7d8 + 29814a9 commit d39bfbe
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit d39bfbe

Please sign in to comment.