Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(breakout-rooms): fix participant menu not closing in breakout rooms (#17091)

mishraditi5199068bd234
diff --git a/react/features/participants-pane/components/breakout-rooms/components/web/CollapsibleRoom.tsx b/react/features/participants-pane/components/breakout-rooms/components/web/CollapsibleRoom.tsx
index 9ffcefaf54..da6f9d75ee 100644
--- a/react/features/participants-pane/components/breakout-rooms/components/web/CollapsibleRoom.tsx
+++ b/react/features/participants-pane/components/breakout-rooms/components/web/CollapsibleRoom.tsx
@@ -32,6 +32,11 @@ interface IProps {
*/
isHighlighted?: boolean;
+ /**
+ * Closes the room participant context menu.
+ */
+ lowerParticipantMenu: Function;
+
/**
* Callback for when the mouse leaves this component.
*/
@@ -118,6 +123,7 @@ export const CollapsibleRoom = ({
raiseParticipantContextMenu,
room,
searchString,
+ lowerParticipantMenu,
toggleParticipantMenu
}: IProps) => {
const { t } = useTranslation();
@@ -155,6 +161,21 @@ export const CollapsibleRoom = ({
participantName: displayName
}), [ room, moderator ]);
+ const getEllipsisClickHandler = useCallback(
+ (jid: string, displayName: string) => {
+ if (participantContextEntity?.jid === jid) {
+ return lowerParticipantMenu;
+ }
+
+ return toggleParticipantMenu({
+ room,
+ jid,
+ participantName: displayName
+ });
+ },
+ [ participantContextEntity, lowerParticipantMenu, toggleParticipantMenu, room ]
+ );
+
return (<>
<ListItem
actions = { children }
@@ -184,9 +205,7 @@ export const CollapsibleRoom = ({
{!overflowDrawer && moderator && (
<ParticipantActionEllipsis
accessibilityLabel = { t('breakoutRoom.more') }
- onClick = { toggleParticipantMenu({ room,
- jid: p.jid,
- participantName: p.displayName }) } />
+ onClick = { getEllipsisClickHandler(p.jid, p.displayName) } />
)}
</ParticipantItem>
))
diff --git a/react/features/participants-pane/components/breakout-rooms/components/web/RoomList.tsx b/react/features/participants-pane/components/breakout-rooms/components/web/RoomList.tsx
index 158b602439..e5119831b8 100644
--- a/react/features/participants-pane/components/breakout-rooms/components/web/RoomList.tsx
+++ b/react/features/participants-pane/components/breakout-rooms/components/web/RoomList.tsx
@@ -80,6 +80,7 @@ export const RoomList = ({ searchString }: IProps) => {
<React.Fragment key = { room.id }>
<CollapsibleRoom
isHighlighted = { true }
+ lowerParticipantMenu = { lowerParticipantMenu }
onRaiseMenu = { onRaiseMenu(room) }
participantContextEntity = { raiseParticipantContext.entity }
raiseParticipantContextMenu = { raiseParticipantMenu }