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(popover) Fix close popover from toggle button (#13180)

Robert Pintiliifd47225d30c2
diff --git a/css/_audio-preview.scss b/css/_audio-preview.scss
index 40a76381fe..782a852c58 100644
--- a/css/_audio-preview.scss
+++ b/css/_audio-preview.scss
@@ -4,6 +4,7 @@
&-content {
position: relative;
right: auto;
+ margin: 0;
margin-bottom: 4px;
max-height: calc(100vh - 100px);
overflow: auto;
diff --git a/css/_popover.scss b/css/_popover.scss
index 4e9920a007..3dd24973dc 100644
--- a/css/_popover.scss
+++ b/css/_popover.scss
@@ -1,25 +1,31 @@
.popover {
- margin: -16px -24px;
z-index: $popoverZ;
.popover-content {
- margin: 16px 24px;
position: relative;
+ }
- &.top {
- bottom: 8px;
- }
+ &.hover {
+ margin: -16px -24px;
- &.bottom {
- top: 4px;
- }
+ .popover-content {
+ margin: 16px 24px;
- &.left {
- right: 4px;
- }
+ &.top {
+ bottom: 8px;
+ }
+
+ &.bottom {
+ top: 4px;
+ }
+
+ &.left {
+ right: 4px;
+ }
- &.right {
- left: 4px;
+ &.right {
+ left: 4px;
+ }
}
}
}
diff --git a/css/_video-preview.scss b/css/_video-preview.scss
index 7745e49339..d8d1b786c7 100644
--- a/css/_video-preview.scss
+++ b/css/_video-preview.scss
@@ -5,6 +5,7 @@
&-container {
max-height: 456px;
overflow: auto;
+ margin: 0;
margin-bottom: 4px;
position: relative;
right: auto;
diff --git a/react/features/base/popover/components/Popover.web.tsx b/react/features/base/popover/components/Popover.web.tsx
index 02e2ba7145..04fefa264d 100644
--- a/react/features/base/popover/components/Popover.web.tsx
+++ b/react/features/base/popover/components/Popover.web.tsx
@@ -424,11 +424,11 @@ class Popover extends Component<IProps, IState> {
* @returns {ReactElement}
*/
_renderContent() {
- const { content, position } = this.props;
+ const { content, position, trigger } = this.props;
return (
<div
- className = 'popover'
+ className = { `popover ${trigger}` }
onKeyDown = { this._onEscKey }>
<div className = { `popover-content ${position.split('-')[0]}` }>
{ content }
diff --git a/react/features/base/toolbox/components/web/ToolboxButtonWithIcon.tsx b/react/features/base/toolbox/components/web/ToolboxButtonWithIcon.tsx
index bedb00213d..9e80e69f45 100644
--- a/react/features/base/toolbox/components/web/ToolboxButtonWithIcon.tsx
+++ b/react/features/base/toolbox/components/web/ToolboxButtonWithIcon.tsx
@@ -110,7 +110,7 @@ export default function ToolboxButtonWithIcon(props: IProps) {
= 'settings-button-small-icon settings-button-small-icon--disabled';
} else {
className = 'settings-button-small-icon';
- iconProps.onClick = () => {
+ iconProps.onClick = (e: React.MouseEvent) => {
if (typeof APP !== 'undefined' && notifyMode) {
APP.API.notifyToolbarButtonClicked(
buttonKey, notifyMode === NOTIFY_CLICK_MODE.PREVENT_AND_NOTIFY
@@ -118,7 +118,7 @@ export default function ToolboxButtonWithIcon(props: IProps) {
}
if (notifyMode !== NOTIFY_CLICK_MODE.PREVENT_AND_NOTIFY) {
- onIconClick();
+ onIconClick(e);
}
};
iconProps.onKeyDown = onIconKeyDown;
diff --git a/react/features/toolbox/components/web/AudioSettingsButton.tsx b/react/features/toolbox/components/web/AudioSettingsButton.tsx
index f59e4e1403..13b1385235 100644
--- a/react/features/toolbox/components/web/AudioSettingsButton.tsx
+++ b/react/features/toolbox/components/web/AudioSettingsButton.tsx
@@ -96,11 +96,13 @@ class AudioSettingsButton extends Component<IProps> {
/**
* Click handler for the more actions entries.
*
+ * @param {MouseEvent} e - Mouse event.
* @returns {void}
*/
- _onClick() {
+ _onClick(e?: React.MouseEvent) {
const { onAudioOptionsClick } = this.props;
+ e?.stopPropagation();
onAudioOptionsClick();
}
diff --git a/react/features/toolbox/components/web/VideoSettingsButton.tsx b/react/features/toolbox/components/web/VideoSettingsButton.tsx
index e8d2368e5a..0da6840729 100644
--- a/react/features/toolbox/components/web/VideoSettingsButton.tsx
+++ b/react/features/toolbox/components/web/VideoSettingsButton.tsx
@@ -113,11 +113,13 @@ class VideoSettingsButton extends Component<IProps> {
/**
* Click handler for the more actions entries.
*
+ * @param {MouseEvent} e - Mousw event.
* @returns {void}
*/
- _onClick() {
+ _onClick(e?: React.MouseEvent) {
const { onVideoOptionsClick } = this.props;
+ e?.stopPropagation();
onVideoOptionsClick();
}