From af9b0d7cf29d612efec5e2f3ba756214ab017f55 Mon Sep 17 00:00:00 2001 From: CrescentLeaf Date: Sat, 20 Sep 2025 17:35:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=94=B1=E6=96=BC=E6=9C=AA=E7=9F=A5?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0=E5=B0=8E=E8=87=B4=E7=9A=84=20=E8=BC=B8?= =?UTF-8?q?=E5=85=A5=E6=A1=86=20=E9=80=83=E7=AB=84=E5=88=B0=20Tab=20?= =?UTF-8?q?=E7=9A=84=20change=20=E4=BA=8B=E4=BB=B6,=20=E9=80=A0=E6=88=90?= =?UTF-8?q?=20Tab=20Panel=20=E9=A1=AF=E7=A4=BA=E7=95=B0=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/ui/chat/ChatFragment.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/ui/chat/ChatFragment.tsx b/client/ui/chat/ChatFragment.tsx index 14e1a6f..6bf7a86 100644 --- a/client/ui/chat/ChatFragment.tsx +++ b/client/ui/chat/ChatFragment.tsx @@ -21,9 +21,9 @@ export default function ChatFragment({ target, ...props }: Args) { } as Chat) const [tabItemSelected, setTabItemSelected] = React.useState('Chat') - const tabRef: React.MutableRefObject = React.useRef(null) - useEventListener(tabRef, 'change', (event) => { - setTabItemSelected((event.target as HTMLElement as Tab).value as string) + const tabRef = React.useRef(null) + useEventListener(tabRef, 'change', () => { + setTabItemSelected(tabRef.current?.value || "Chat") }) React.useEffect(() => { @@ -38,6 +38,7 @@ export default function ChatFragment({ target, ...props }: Args) { })() }, [target]) + console.log(tabItemSelected) return (