Skip to content

Commit

Permalink
fix(community-side-navigation): fix submenu not opening when uglified
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew-K-Lam authored and theetrain committed Jan 14, 2019
1 parent 147d8d2 commit 872b124
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
3 changes: 2 additions & 1 deletion packages/SideNavigation/SideNavigation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ class SideNavigation extends Component {
{React.Children.map(children, (child, index) => {
let options = {}
const id = `TDS-SideNavigation-${index}`
if (child.type.name === 'SubMenu') {
// check if href is in props to figure out if child is SubMenu or Link
if (!('href' in child.props)) {
options = {
onClick: this.toggleOpen,
isOpen: this.checkAccordion(id),
Expand Down
11 changes: 5 additions & 6 deletions packages/SideNavigation/SubMenu/SubMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@ const SubMenu = ({ children, label, onClick, id, isOpen, active }) => {
subMenuLink: true,
}

const onSubMenuClick = () => {
onClick(id)
}

return (
<div className={styles.mainDiv}>
<button
onClick={() => {
onClick(id)
}}
className={active ? styles.active : styles.buttonDefault}
>
<button onClick={onSubMenuClick} className={active ? styles.active : styles.buttonDefault}>
<Box vertical={3} inline horizontal={2} dangerouslyAddClassName={styles.space}>
<ColoredTextProvider>
<Text size="medium" bold={active}>
Expand Down

0 comments on commit 872b124

Please sign in to comment.