From 3d4cbf46627cfd5ca2e67c5bc9bbc82f09dd3323 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 2 Feb 2026 13:10:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BD=BF=E7=94=A8=20Portal=20=E6=B8=B2?= =?UTF-8?q?=E6=9F=93=E6=A0=87=E7=AD=BE=E9=A2=84=E8=A7=88=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E5=88=B0=20body=EF=BC=8C=E4=BF=AE=E5=A4=8D=20backdrop-blur=20?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=20fixed=20=E5=AE=9A=E4=BD=8D=E5=A4=B1?= =?UTF-8?q?=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/canvas/CanvasChatPanel.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/canvas/CanvasChatPanel.tsx b/components/canvas/CanvasChatPanel.tsx index 6953c3d29..916697160 100644 --- a/components/canvas/CanvasChatPanel.tsx +++ b/components/canvas/CanvasChatPanel.tsx @@ -3,6 +3,7 @@ import { useChat } from "@ai-sdk/react"; import { DefaultChatTransport } from "ai"; import { useEffect, useRef, useState, useCallback } from "react"; +import { createPortal } from "react-dom"; import { useRouter } from "next/navigation"; import useSWR from "swr"; import { Send, Loader2, ImagePlus, Paperclip, X, Sparkles, User, Bot, Plus, History, Share2, LayoutGrid, Maximize2, RefreshCw, Zap, Globe, Box, ArrowUp } from "lucide-react"; @@ -1483,7 +1484,8 @@ export function CanvasChatPanel({ chatId, initialMessages = [], onClose, onOpenF top = padding; } - return ( + // 使用 Portal 渲染到 body,避免 backdrop-blur 影响 fixed 定位 + return createPortal(
)}
- + , + document.body ); })()}