From c327dc33bf91c85453ab5a2d5149fb1035f6a122 Mon Sep 17 00:00:00 2001 From: Germain Date: Fri, 1 Sep 2023 14:37:47 +0100 Subject: [PATCH 1/3] Prevent event propagation when clicking icon buttons --- src/components/views/rooms/RoomHeader.tsx | 78 +++++++++++++---------- 1 file changed, 45 insertions(+), 33 deletions(-) diff --git a/src/components/views/rooms/RoomHeader.tsx b/src/components/views/rooms/RoomHeader.tsx index cdfd6d833dc..614f16b6eec 100644 --- a/src/components/views/rooms/RoomHeader.tsx +++ b/src/components/views/rooms/RoomHeader.tsx @@ -175,43 +175,55 @@ export default function RoomHeader({ room }: { room: Room }): JSX.Element { {!useElementCallExclusively && ( + + { + evt.stopPropagation(); + placeCall(room, CallType.Voice, voiceCallType); + }} + > + + + + )} + { - placeCall(room, CallType.Voice, voiceCallType); + disabled={!!videoCallDisabledReason} + title={!videoCallDisabledReason ? _t("Video call") : videoCallDisabledReason!} + onClick={(evt) => { + evt.stopPropagation(); + placeCall(room, CallType.Video, videoCallType); }} > - + - )} - { - placeCall(room, CallType.Video, videoCallType); - }} - > - - - { - showOrHidePanel(RightPanelPhases.ThreadPanel); - }} - title={_t("common|threads")} - > - - - { - showOrHidePanel(RightPanelPhases.NotificationPanel); - }} - title={_t("Notifications")} - > - - + + + { + evt.stopPropagation(); + showOrHidePanel(RightPanelPhases.ThreadPanel); + }} + title={_t("common|threads")} + > + + + + + { + evt.stopPropagation(); + showOrHidePanel(RightPanelPhases.NotificationPanel); + }} + title={_t("Notifications")} + > + + + {!isDirectMessage && ( Date: Fri, 1 Sep 2023 14:40:50 +0100 Subject: [PATCH 2/3] Inhibit view user on click behaviour for room header face pile --- src/components/views/elements/FacePile.tsx | 19 +++++++++++++++++-- src/components/views/rooms/RoomHeader.tsx | 1 + 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/components/views/elements/FacePile.tsx b/src/components/views/elements/FacePile.tsx index 47c05598ba7..ab71cff7cbe 100644 --- a/src/components/views/elements/FacePile.tsx +++ b/src/components/views/elements/FacePile.tsx @@ -27,15 +27,30 @@ interface IProps extends HTMLAttributes { tooltipLabel?: string; tooltipShortcut?: string; children?: ReactNode; + viewUserOnClick?: boolean; } -const FacePile: FC = ({ members, size, overflow, tooltipLabel, tooltipShortcut, children, ...props }) => { +const FacePile: FC = ({ + members, + size, + overflow, + tooltipLabel, + tooltipShortcut, + children, + viewUserOnClick = true, + ...props +}) => { const faces = members.map( tooltipLabel ? (m) => : (m) => ( - + ), ); diff --git a/src/components/views/rooms/RoomHeader.tsx b/src/components/views/rooms/RoomHeader.tsx index 614f16b6eec..78d3f8139f3 100644 --- a/src/components/views/rooms/RoomHeader.tsx +++ b/src/components/views/rooms/RoomHeader.tsx @@ -241,6 +241,7 @@ export default function RoomHeader({ room }: { room: Room }): JSX.Element { members={members.slice(0, 3)} size="20px" overflow={false} + viewUserOnClick={false} > {formatCount(memberCount)} From 5ed2a225a893082c4b857910a2fcc6b68e24f748 Mon Sep 17 00:00:00 2001 From: Germain Date: Fri, 1 Sep 2023 14:48:04 +0100 Subject: [PATCH 3/3] Update snapshot --- .../views/rooms/__snapshots__/RoomHeader-test.tsx.snap | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/components/views/rooms/__snapshots__/RoomHeader-test.tsx.snap b/test/components/views/rooms/__snapshots__/RoomHeader-test.tsx.snap index d1ddaeeb429..c501271b371 100644 --- a/test/components/views/rooms/__snapshots__/RoomHeader-test.tsx.snap +++ b/test/components/views/rooms/__snapshots__/RoomHeader-test.tsx.snap @@ -37,6 +37,7 @@ exports[`RoomHeader does not show the face pile for DMs 1`] = ` >