Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions apps/meteor/client/views/room/components/body/RoomBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
useUser,
useUserPreference,
} from '@rocket.chat/ui-contexts';
import type { ReactElement, UIEvent } from 'react';
import type { MouseEventHandler, ReactElement, UIEvent } from 'react';
import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { useSyncExternalStore } from 'use-sync-external-store/shim';

Expand Down Expand Up @@ -532,6 +532,21 @@ const RoomBody = (): ReactElement => {
chat.uploads.wipeFailedOnes();
}, [chat]);

const handleCloseFlexTab: MouseEventHandler<HTMLElement> = useCallback(
(e): void => {
if (!hideFlexTab) {
return;
}

if (e.target instanceof HTMLButtonElement) {
return;
}

toolbox.close();
},
[toolbox, hideFlexTab],
);

return (
<>
{!isLayoutEmbedded && room.announcement && <Announcement announcement={room.announcement} announcementDetails={undefined} />}
Expand All @@ -540,7 +555,7 @@ const RoomBody = (): ReactElement => {
className={`messages-container flex-tab-main-content ${admin ? 'admin' : ''}`}
id={`chat-window-${room._id}`}
aria-label={t('Channel')}
onClick={hideFlexTab ? toolbox.close : undefined}
onClick={handleCloseFlexTab}
>
<div className='messages-container-wrapper'>
<div className='messages-container-main' {...fileUploadTriggerProps}>
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -2350,7 +2350,7 @@
"Hidden": "Hidden",
"Hide": "Hide",
"Hide_counter": "Hide counter",
"Hide_flextab": "Hide Right Sidebar with Click",
"Hide_flextab": "Hide Contextual Bar by clicking outside of it",
"Hide_Group_Warning": "Are you sure you want to hide the group \"%s\"?",
"Hide_Livechat_Warning": "Are you sure you want to hide the chat with \"%s\"?",
"Hide_Private_Warning": "Are you sure you want to hide the discussion with \"%s\"?",
Expand Down