From 84657f91f99754771ae5867c783cc639bda18c99 Mon Sep 17 00:00:00 2001 From: LanQin_ Date: Thu, 25 Jun 2026 11:30:37 +0800 Subject: [PATCH] =?UTF-8?q?fix(toast):=20=E4=BF=AE=E5=A4=8D=20Toast=20?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E4=BA=A4=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 为可点击的 Toast 添加指针样式,提升交互反馈。 - 阻止关闭按钮点击事件冒泡,避免触发外层点击逻辑。 --- apps/web/src/components/ui/toast.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/web/src/components/ui/toast.tsx b/apps/web/src/components/ui/toast.tsx index 40ac9dd..da11088 100644 --- a/apps/web/src/components/ui/toast.tsx +++ b/apps/web/src/components/ui/toast.tsx @@ -48,7 +48,7 @@ const Toast = React.forwardRef< return ( ) @@ -76,6 +76,10 @@ const ToastClose = React.forwardRef< >(({ className, ...props }, ref) => ( { + event.stopPropagation() + props.onClick?.(event) + }} className={cn( "absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600", className