A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
editor: hide hover popup on editor destroy
Abdullah Attad31194bb3964
diff --git a/packages/editor/src/toolbar/floating-menus/hover-popup/index.tsx b/packages/editor/src/toolbar/floating-menus/hover-popup/index.tsxindex f12deab63..878ceae1a 100644--- a/packages/editor/src/toolbar/floating-menus/hover-popup/index.tsx+++ b/packages/editor/src/toolbar/floating-menus/hover-popup/index.tsx@@ -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) {