Skip to content

Commit

Permalink
fix: activetab check isVisible
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Jan 7, 2021
1 parent 73723af commit cfe66ea
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions ui/app/src/SidebarsPage/SidebarsStoryPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,12 @@ export const SidebarsStoryPage: FC<DocPageProps> = ({ type, doc }) => {
});

const { tabIndex, tabConfig } = useMemo(() => {
const selectedTab = activeTab
? activeTab
: tabs?.length > 0
? tabs[0]
: undefined;
const selectedTab =
activeTab && tabs.includes(activeTab)
? activeTab
: tabs?.length > 0
? tabs[0]
: undefined;
const tabIndex = Math.max(
tabs.findIndex(route => route === selectedTab),
0,
Expand Down

0 comments on commit cfe66ea

Please sign in to comment.