Skip to content

Commit

Permalink
fix: only toggle current page if active
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Aug 9, 2020
1 parent 2c62bd3 commit d00e2df
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/NavigationItems.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ const NavItem = ({ page, depthLevel, searchTerm, filteredPageNames }) => {
{page.url ? (
<Link
onClick={
isToggleable ? () => setToggleIsExpanded(!toggleIsExpanded) : null
isToggleable && isCurrentPage
? () => setToggleIsExpanded(!toggleIsExpanded)
: null
}
className={cx(styles.navLink, {
[styles.isCurrentPage]: isCurrentPage,
Expand Down

0 comments on commit d00e2df

Please sign in to comment.