Story Toggler: Hide stories when search field is focused (#5583)

This commit is contained in:
Alexander Zinchuk 2025-02-13 14:28:07 +01:00
parent 37617b4b8e
commit 92bb456d95

View File

@ -192,11 +192,11 @@ const LeftMainHeader: FC<OwnProps & StateProps> = ({
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]);