Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit 2ece67b

Browse files
author
manajdov
committed
-improved example
-fixed issue with the condition for the active prop
1 parent 4c8e2d6 commit 2ece67b

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

docs/src/examples/components/Menu/Types/index.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@ const Types = () => (
2424
description="A menu can have submenus."
2525
examplePath="components/Menu/Types/MenuExampleWithSubmenu"
2626
/>
27-
<ComponentExample
28-
title="Vertical menu with submenus"
29-
description="A vertical menu can have submenu."
30-
examplePath="components/Menu/Types/MenuExampleVerticalWithSubmenu"
31-
/>
27+
<ComponentExample examplePath="components/Menu/Types/MenuExampleVerticalWithSubmenu" />
3228
</ExampleSection>
3329
)
3430

src/components/Menu/Menu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class Menu extends AutoControlledComponent<Extendable<MenuProps>, MenuState> {
143143

144144
return _.map(items, (item, index) => {
145145
const active =
146-
typeof activeIndex === 'string' ? parseInt(activeIndex, 10) : activeIndex === index
146+
(typeof activeIndex === 'string' ? parseInt(activeIndex, 10) : activeIndex) === index
147147
return MenuItem.create(item, {
148148
defaultProps: {
149149
iconOnly,

0 commit comments

Comments
 (0)