From bcf09974f51f576eeed29ed12c34dec06c38c16a Mon Sep 17 00:00:00 2001 From: jinmiaoluo <39730824+jinmiaoluo@users.noreply.github.com> Date: Sat, 29 Apr 2023 08:36:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=A7=84=E9=81=BF=20onClick?= =?UTF-8?q?=20=E5=86=92=E6=B3=A1=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/chat-list.tsx | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/app/components/chat-list.tsx b/app/components/chat-list.tsx index f3a396835..b33f2a8a9 100644 --- a/app/components/chat-list.tsx +++ b/app/components/chat-list.tsx @@ -16,7 +16,6 @@ import { Link, useNavigate } from "react-router-dom"; import { Path } from "../constant"; import { MaskAvatar } from "./mask"; import { Mask } from "../store/mask"; -import { MouseEvent } from "react"; export function ChatItem(props: { onClick?: () => void; @@ -30,14 +29,6 @@ export function ChatItem(props: { narrow?: boolean; mask: Mask; }) { - const handleDeleteClick = (event: MouseEvent) => { - // Avoid triggering the onClick event of the parent component. - event.stopPropagation(); - if (props.onDelete) { - props.onDelete(); - } - }; - return ( {(provided) => ( @@ -78,7 +69,11 @@ export function ChatItem(props: {
{ + // Avoid triggering the onClick event of the parent component + e.stopPropagation(); + props.onDelete?.(); + }} >