From a25e96af87acfa70f3210b91c247ea172e39b176 Mon Sep 17 00:00:00 2001 From: wangfanghua Date: Mon, 29 Jan 2024 14:00:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3tabs=E7=89=B9=E5=AE=9A?= =?UTF-8?q?=E5=9C=BA=E6=99=AF=E4=B8=8B=EF=BC=8C=E5=88=87=E6=8D=A2=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E9=A1=B5=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98=EF=BC=9B?= =?UTF-8?q?=E5=AF=B9=E5=BA=94issue#9544?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/amis-ui/src/components/Tabs.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/amis-ui/src/components/Tabs.tsx b/packages/amis-ui/src/components/Tabs.tsx index 6a049253c..7dbb2dcc5 100644 --- a/packages/amis-ui/src/components/Tabs.tsx +++ b/packages/amis-ui/src/components/Tabs.tsx @@ -388,8 +388,8 @@ export class Tabs extends React.Component { } const {activeKey, children} = this.props; const currentKey = key !== undefined ? key : activeKey; - const currentIndex = (children as any[])?.findIndex( - (item: any) => item.props.eventKey === currentKey + const currentIndex = (children as any[])?.findIndex((item: any) => + item === null ? false : item.props.eventKey === currentKey ); const li = this.navMain.current?.children || []; const currentLi = li[currentIndex] as HTMLElement;