mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-08-29 10:09:26 +02:00
editor: fix multiple link hover popups from opening (#10233)
* also fix the popup not opening when quickly hovering one link after another Signed-off-by: 01zulfi <85733202+01zulfi@users.noreply.github.com>
This commit is contained in:
@@ -70,16 +70,12 @@ export function HoverPopupHandler(props: FloatingMenuProps) {
|
||||
const element = e.target;
|
||||
|
||||
if (activePopup.current) {
|
||||
const isOutsideEditor = !element.closest(".ProseMirror");
|
||||
const isInsidePopup = element.closest(".popup-presenter-portal");
|
||||
const isActiveElement = activePopup.current.element === element;
|
||||
if (isInsidePopup) return;
|
||||
if (isInsidePopup || isActiveElement) return;
|
||||
|
||||
if (isOutsideEditor || !isActiveElement) {
|
||||
activePopup.current.hide();
|
||||
activePopup.current = undefined;
|
||||
return;
|
||||
}
|
||||
activePopup.current.hide();
|
||||
activePopup.current = undefined;
|
||||
}
|
||||
|
||||
clearTimeout(hoverTimeoutId.current);
|
||||
|
||||
Reference in New Issue
Block a user