Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
owenniblock committed Mar 1, 2024
1 parent cefd7e1 commit 615a29c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions packages/react/src/TabPanels/TabPanels.features.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ export default {
export const Selected = () => (
<TabPanels aria-label="TabPanels example" id="tab-panels">
<TabPanels.Tab>One</TabPanels.Tab>
<TabPanels.Tab selected>
Two
</TabPanels.Tab>
<TabPanels.Tab selected>Two</TabPanels.Tab>
<TabPanels.Tab>Three</TabPanels.Tab>
<TabPanels.Panel>One</TabPanels.Panel>
<TabPanels.Panel>Two</TabPanels.Panel>
Expand Down Expand Up @@ -48,9 +46,7 @@ export const ManyTabs = () => (
<TabPanels.Tab>Eight</TabPanels.Tab>
<TabPanels.Tab>Nine</TabPanels.Tab>
<TabPanels.Tab>Ten</TabPanels.Tab>
<TabPanels.Tab selected>
Eleven
</TabPanels.Tab>
<TabPanels.Tab selected>Eleven</TabPanels.Tab>
<TabPanels.Panel>One</TabPanels.Panel>
<TabPanels.Panel>Two</TabPanels.Panel>
<TabPanels.Panel>Three</TabPanels.Panel>
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/TabPanels/TabPanels.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function TabPanels({children, id, ...props}: TabPanelsProps) {
// If it's a panel, then add aria-labelledby="{id}-tab-{index}"
let tabIndex = 0
let panelIndex = 0
const childrenWithProps = React.Children.map(children, (child) => {
const childrenWithProps = React.Children.map(children, child => {
if (React.isValidElement<TabPanelsTabProps>(child) && child.type === Tab && !child.props.id) {
return React.cloneElement(child, {id: `${id}-tab-${tabIndex++}`})
}
Expand Down

0 comments on commit 615a29c

Please sign in to comment.