mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-01 19:49:54 +02:00
editor: hide hover popup on editor destroy
This commit is contained in:
@@ -38,6 +38,16 @@ export function HoverPopupHandler(props: FloatingMenuProps) {
|
||||
const hoverTimeoutId = useRef<number>();
|
||||
const activePopup = useRef<{ element: HTMLElement; hide: () => void }>();
|
||||
|
||||
useEffect(() => {
|
||||
function onDestroy() {
|
||||
activePopup.current?.hide();
|
||||
}
|
||||
editor.on("destroy", onDestroy);
|
||||
return () => {
|
||||
editor.off("destroy", onDestroy);
|
||||
};
|
||||
}, []);
|
||||
|
||||
useEffect(
|
||||
() => {
|
||||
function onMouseOver(e: MouseEvent) {
|
||||
|
||||
Reference in New Issue
Block a user