From 92bb456d9586f3be84de2261c5828439aa3b7328 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Thu, 13 Feb 2025 14:28:07 +0100 Subject: [PATCH] Story Toggler: Hide stories when search field is focused (#5583) --- src/components/left/main/LeftMainHeader.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/left/main/LeftMainHeader.tsx b/src/components/left/main/LeftMainHeader.tsx index 62b32deac..34150380a 100644 --- a/src/components/left/main/LeftMainHeader.tsx +++ b/src/components/left/main/LeftMainHeader.tsx @@ -192,11 +192,11 @@ const LeftMainHeader: FC = ({ lockScreen(); }); - const isSearchFocused = !isMessageListOpen && ( - Boolean(globalSearchChatId) + const isSearchRelevant = Boolean(globalSearchChatId) || content === LeftColumnContent.GlobalSearch - || content === LeftColumnContent.Contacts - ); + || content === LeftColumnContent.Contacts; + + const isSearchFocused = isMobile ? !isMessageListOpen && isSearchRelevant : isSearchRelevant; useEffect(() => (isSearchFocused ? captureEscKeyListener(() => onReset()) : undefined), [isSearchFocused, onReset]);