mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:39:05 +08:00
Merge pull request #9545 from TigerWFH/feature_issue_tabs
fix: 修正tabs特定场景下,切换标签页报错问题;对应issue#9544
This commit is contained in:
commit
7a931a3901
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user