aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--packages/react-shared/src/components/nested_sidebar_menu.tsx12
1 files changed, 11 insertions, 1 deletions
diff --git a/packages/react-shared/src/components/nested_sidebar_menu.tsx b/packages/react-shared/src/components/nested_sidebar_menu.tsx
index 3c61fb0b1..14b233cd6 100644
--- a/packages/react-shared/src/components/nested_sidebar_menu.tsx
+++ b/packages/react-shared/src/components/nested_sidebar_menu.tsx
@@ -101,7 +101,11 @@ export class NestedSidebarMenu extends React.Component<NestedSidebarMenuProps, N
duration={constants.DOCS_SCROLL_DURATION_MS}
containerId={constants.DOCS_CONTAINER_ID}
>
- <MenuItem style={menuItemStyles} innerDivStyle={menuItemInnerDivStyles}>
+ <MenuItem
+ style={menuItemStyles}
+ innerDivStyle={menuItemInnerDivStyles}
+ onClick={this._onMenuItemClick.bind(this)}
+ >
<span
style={{
textTransform: this.props.shouldReformatMenuItemNames ? 'capitalize' : 'none',
@@ -145,6 +149,7 @@ export class NestedSidebarMenu extends React.Component<NestedSidebarMenuProps, N
fontSize: 14,
lineHeight: '35px',
}}
+ onClick={this._onMenuItemClick.bind(this)}
>
{entityName}
</MenuItem>
@@ -155,4 +160,9 @@ export class NestedSidebarMenu extends React.Component<NestedSidebarMenuProps, N
</ul>
);
}
+ private _onMenuItemClick(): void {
+ if (!_.isUndefined(this.props.onMenuItemClick)) {
+ this.props.onMenuItemClick();
+ }
+ }
}