Skip to content

Commit

Permalink
fix(ui-tabs): fix id generation when null is present as children
Browse files Browse the repository at this point in the history
Closes: INSTUI-4089
  • Loading branch information
HerrTopi authored and balzss committed Jun 13, 2024
1 parent efbe3f6 commit c13fd7f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/ui-tabs/src/Tabs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ class Tabs extends Component<TabsProps, TabsState> {

const selectedIndex = selectedChildIndex >= 0 ? selectedChildIndex : 0

React.Children.forEach(children as PanelChild[], (child, index) => {
React.Children.toArray(children).map((child, index) => {
if (matchComponentTypes<PanelChild>(child, [Panel])) {
const selected =
!child.props.isDisabled &&
Expand All @@ -482,7 +482,7 @@ class Tabs extends Component<TabsProps, TabsState> {
panels.push(this.clonePanel(index, id, selected, child))
}
} else {
panels.push(child)
panels.push(child as PanelChild)
}
})

Expand Down

0 comments on commit c13fd7f

Please sign in to comment.