diff --git a/src/components/middle/composer/AttachmentModal.tsx b/src/components/middle/composer/AttachmentModal.tsx index 4a439e8c..117612c2 100644 --- a/src/components/middle/composer/AttachmentModal.tsx +++ b/src/components/middle/composer/AttachmentModal.tsx @@ -244,7 +244,7 @@ const AttachmentModal: FC = ({ placeholder={lang('Caption')} onUpdate={onCaptionUpdate} onSend={onSend} - shouldSetFocus={isOpen} + shouldSetFocus={Boolean(attachments.length)} /> diff --git a/src/components/middle/composer/Composer.tsx b/src/components/middle/composer/Composer.tsx index 3ab3d8c6..f1a16dbe 100644 --- a/src/components/middle/composer/Composer.tsx +++ b/src/components/middle/composer/Composer.tsx @@ -919,7 +919,7 @@ const Composer: FC = ({ : botKeyboardPlaceholder || lang('Message') } forcedPlaceholder={inlineBotHelp} - shouldSetFocus={isSymbolMenuOpen} + shouldSetFocus={!attachments.length} shouldSuppressFocus={IS_SINGLE_COLUMN_LAYOUT && isSymbolMenuOpen} shouldSuppressTextFormatter={isEmojiTooltipOpen || isMentionTooltipOpen || isInlineBotTooltipOpen} onUpdate={setHtml} diff --git a/src/components/middle/composer/MessageInput.tsx b/src/components/middle/composer/MessageInput.tsx index dcfab0ca..6bbb5396 100644 --- a/src/components/middle/composer/MessageInput.tsx +++ b/src/components/middle/composer/MessageInput.tsx @@ -329,7 +329,9 @@ const MessageInput: FC = ({ return; } - focusInput(); + if (shouldSetFocus) { + focusInput(); + } }, [currentChatId, focusInput, replyingToId, shouldSetFocus]); useEffect(() => {