Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(calendar): place the event popover again once its note fills it
Elian Doran9862cdb2e231
diff --git a/apps/client/src/widgets/react/Popover.tsx b/apps/client/src/widgets/react/Popover.tsxindex 56cd6600c0..eac6547447 100644--- a/apps/client/src/widgets/react/Popover.tsx+++ b/apps/client/src/widgets/react/Popover.tsx@@ -4,9 +4,10 @@ import { createPopper, Instance, Placement, VirtualElement } from "@popperjs/corimport clsx from "clsx";import { ComponentChildren } from "preact";import { createPortal } from "preact/compat";-import { useEffect, useRef } from "preact/hooks";+import { useCallback, useEffect, useRef } from "preact/hooks";import { FLOATING_LAYER_SELECTOR, isWithinFloatingLayer } from "./floating_layers";+import { useResizeObserver } from "./hooks";export interface PopoverProps {/**@@ -94,6 +95,10 @@ export default function Popover({ getAnchorRect, placement, updateKey, classNamevoid popperRef.current?.update();}, [ updateKey ]);+ // Placed again whenever what is placed changes size: what a popover holds arrives after it does+ // — a note's editor mounting, its promoted attributes filling in — and Popper measures it once.+ useResizeObserver(elRef, useCallback(() => void popperRef.current?.update(), []));+useEffect(() => {if (!onDismiss) return;