From 44ae91cdcc3a5700146d6a7f32c83f10dd329afa Mon Sep 17 00:00:00 2001 From: Robin Townsend Date: Wed, 23 Feb 2022 21:30:54 -0500 Subject: [PATCH] Fix vanishing recently viewed menu Signed-off-by: Robin Townsend --- src/components/views/elements/InteractiveTooltip.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/views/elements/InteractiveTooltip.tsx b/src/components/views/elements/InteractiveTooltip.tsx index c8920abecde..62d0c43d06a 100644 --- a/src/components/views/elements/InteractiveTooltip.tsx +++ b/src/components/views/elements/InteractiveTooltip.tsx @@ -357,7 +357,7 @@ export default class InteractiveTooltip extends React.Component } else { const targetRight = targetRect.right + window.pageXOffset; const spaceOnRight = UIStore.instance.windowWidth - targetRight; - return !contentRect || (spaceOnRight - contentRect.width < MIN_SAFE_DISTANCE_TO_WINDOW_EDGE); + return contentRect && (spaceOnRight - contentRect.width < MIN_SAFE_DISTANCE_TO_WINDOW_EDGE); } } @@ -371,7 +371,7 @@ export default class InteractiveTooltip extends React.Component } else { const targetBottom = targetRect.bottom + window.pageYOffset; const spaceBelow = UIStore.instance.windowHeight - targetBottom; - return !contentRect || (spaceBelow - contentRect.height < MIN_SAFE_DISTANCE_TO_WINDOW_EDGE); + return contentRect && (spaceBelow - contentRect.height < MIN_SAFE_DISTANCE_TO_WINDOW_EDGE); } }