Skip to content

Commit

Permalink
Update handle selection logic to use else if
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuatf committed Jan 2, 2023
1 parent b991862 commit c64730c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/components/src/tab-panel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ export function TabPanel( {
? initialTab.name
: firstEnabledTab.name
);
}
if ( selectedTab?.disabled && firstEnabledTab ) {
} else if ( selectedTab?.disabled && firstEnabledTab ) {
handleTabSelection( firstEnabledTab.name );
}
}, [
Expand Down

1 comment on commit c64730c

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/3824637088
📝 Reported issues:

Please sign in to comment.