mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
hide tooltip when button menu is opened (#13247)
GitOrigin-RevId: 1b6c1b09477dc9435996f3e190a72eb1a6c1d5cf
This commit is contained in:
parent
a05c201652
commit
61e7f6f3a8
2 changed files with 8 additions and 1 deletions
|
@ -69,6 +69,7 @@ export const ToolbarButtonMenu: FC<{
|
|||
return (
|
||||
<>
|
||||
<Tooltip
|
||||
hidden={open}
|
||||
id={id}
|
||||
description={<div>{label}</div>}
|
||||
overlayProps={{ placement: 'bottom' }}
|
||||
|
|
|
@ -15,6 +15,7 @@ export type TooltipProps = {
|
|||
id: string
|
||||
overlayProps?: OverlayProps
|
||||
tooltipProps?: BSTooltip.TooltipProps
|
||||
hidden?: boolean
|
||||
children: React.ReactElement
|
||||
}
|
||||
|
||||
|
@ -24,6 +25,7 @@ function Tooltip({
|
|||
children,
|
||||
tooltipProps,
|
||||
overlayProps,
|
||||
hidden,
|
||||
}: TooltipProps) {
|
||||
const hideTooltip = (e: React.MouseEvent) => {
|
||||
if (e.currentTarget instanceof HTMLElement) {
|
||||
|
@ -34,7 +36,11 @@ function Tooltip({
|
|||
return (
|
||||
<OverlayTrigger
|
||||
overlay={
|
||||
<BSTooltip id={`${id}-tooltip`} {...tooltipProps}>
|
||||
<BSTooltip
|
||||
id={`${id}-tooltip`}
|
||||
{...tooltipProps}
|
||||
style={{ display: hidden ? 'none' : 'block' }}
|
||||
>
|
||||
{description}
|
||||
</BSTooltip>
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue