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:
01zulfi
2026-08-17 10:11:46 +05:00
committed by GitHub
parent dc3f38f67d
commit 20b4585361

View File

@@ -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);