From 09719bb9cfd2dee80452fe97f7be2ce1a106229c Mon Sep 17 00:00:00 2001 From: yangdx Date: Mon, 7 Apr 2025 20:09:43 +0800 Subject: [PATCH] Fix Safari popover problem --- .../src/components/graph/LayoutsControl.tsx | 13 +++++-- .../src/components/graph/Settings.tsx | 6 ++-- lightrag_webui/src/components/ui/Popover.tsx | 36 ++++++++++++------- 3 files changed, 38 insertions(+), 17 deletions(-) diff --git a/lightrag_webui/src/components/graph/LayoutsControl.tsx b/lightrag_webui/src/components/graph/LayoutsControl.tsx index 1933ce19..c4ec67be 100644 --- a/lightrag_webui/src/components/graph/LayoutsControl.tsx +++ b/lightrag_webui/src/components/graph/LayoutsControl.tsx @@ -289,7 +289,7 @@ const LayoutsControl = () => { ) return ( - <> +
{layouts[layout] && 'worker' in layouts[layout] && ( { - + @@ -331,7 +338,7 @@ const LayoutsControl = () => {
- +
) } diff --git a/lightrag_webui/src/components/graph/Settings.tsx b/lightrag_webui/src/components/graph/Settings.tsx index 5f541e3d..758f6d58 100644 --- a/lightrag_webui/src/components/graph/Settings.tsx +++ b/lightrag_webui/src/components/graph/Settings.tsx @@ -245,8 +245,10 @@ export default function Settings() { e.preventDefault()} >
diff --git a/lightrag_webui/src/components/ui/Popover.tsx b/lightrag_webui/src/components/ui/Popover.tsx index b81456ef..d281daa4 100644 --- a/lightrag_webui/src/components/ui/Popover.tsx +++ b/lightrag_webui/src/components/ui/Popover.tsx @@ -7,20 +7,32 @@ const Popover = PopoverPrimitive.Root const PopoverTrigger = PopoverPrimitive.Trigger +// Define the props type to include positioning props +type PopoverContentProps = React.ComponentPropsWithoutRef & { + collisionPadding?: number | Partial>; + sticky?: 'partial' | 'always'; + avoidCollisions?: boolean; +}; + const PopoverContent = React.forwardRef< React.ComponentRef, - React.ComponentPropsWithoutRef ->(({ className, align = 'center', sideOffset = 4, ...props }, ref) => ( - + PopoverContentProps +>(({ className, align = 'center', sideOffset = 4, collisionPadding, sticky, avoidCollisions = false, ...props }, ref) => ( + + + )) PopoverContent.displayName = PopoverPrimitive.Content.displayName