Skip to content

Commit

Permalink
Merge pull request baidu#9545 from TigerWFH/feature_issue_tabs
Browse files Browse the repository at this point in the history
fix: 修正tabs特定场景下,切换标签页报错问题;对应issue#9544
  • Loading branch information
zhangtao07 committed Jan 30, 2024
2 parents 5042c82 + a25e96a commit 7a931a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/amis-ui/src/components/Tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,8 @@ export class Tabs extends React.Component<TabsProps, any> {
}
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;
Expand Down

0 comments on commit 7a931a3

Please sign in to comment.