Fix call react button lingering tooltip

This commit is contained in:
ayumi-signal 2024-04-29 12:16:12 -07:00 committed by GitHub
parent bef5fd6b34
commit f02a11bc9b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 32 additions and 28 deletions

View file

@ -110,10 +110,6 @@
margin-block: -5px; margin-block: -5px;
} }
.CallControls__ReactButtonContainer--menu-shown .module-tooltip {
opacity: 0;
}
.CallControls__OuterSpacer { .CallControls__OuterSpacer {
// Defined in _modules but duplicated here for ease of refactor // Defined in _modules but duplicated here for ease of refactor
$local-preview-width: 108px; $local-preview-width: 108px;

View file

@ -111,34 +111,42 @@ export function CallingButton({
tooltipContent = i18n('icu:CallingButton--more-options'); tooltipContent = i18n('icu:CallingButton--more-options');
} }
const buttonContent = (
<button
aria-label={tooltipContent}
className={classNames(
'CallingButton__icon',
`CallingButton__icon--${classNameSuffix}`
)}
disabled={disabled}
id={uniqueButtonId}
onClick={onClick}
onMouseEnter={onMouseEnter}
onMouseLeave={onMouseLeave}
type="button"
>
<div />
</button>
);
return ( return (
<div className="CallingButton"> <div className="CallingButton">
<Tooltip {tooltipContent === '' ? (
className="CallingButton__tooltip" <div className="CallingButton__button-container">{buttonContent}</div>
wrapperClassName={classNames( ) : (
'CallingButton__button-container', <Tooltip
!isVisible && 'CallingButton__button-container--hidden' className="CallingButton__tooltip"
)} wrapperClassName={classNames(
content={tooltipContent} 'CallingButton__button-container',
direction={tooltipDirection} !isVisible && 'CallingButton__button-container--hidden'
theme={Theme.Dark}
>
<button
aria-label={tooltipContent}
className={classNames(
'CallingButton__icon',
`CallingButton__icon--${classNameSuffix}`
)} )}
disabled={disabled} content={tooltipContent}
id={uniqueButtonId} direction={tooltipDirection}
onClick={onClick} theme={Theme.Dark}
onMouseEnter={onMouseEnter}
onMouseLeave={onMouseLeave}
type="button"
> >
<div /> {buttonContent}
</button> </Tooltip>
</Tooltip> )}
</div> </div>
); );
} }