Skip to content

openKeys becomes undefined in Menu.componentWillReceiveProps #74

@williamkhshea

Description

@williamkhshea

I have got a SubMenu like this:

      <div>
        <Menu mode="horizontal" id="nav">
          <SubMenu title="John">
            <MenuItemGroup key="actions" title="Actions">
              <Menu.Item key="createCompany">
                <a href="#" >Create Company</a>
              </Menu.Item>
              <Menu.Item key="signOut">
                <a href="#" >Sign Out</a>
              </Menu.Item>
            </MenuItemGroup>
          </SubMenu>
        </Menu>
      </div>

For some reason it triggers the componentWillReceiveProps immediately after it first render, and openKeys is undefined in nextProps so it passes on causing an error in isOpen in SubMenu
screen shot 2017-01-22 at 5 09 43 am

I spent a couple of hours and still cannot reproduce in it online. Adding a guard clause against undefined openKeys (and for selectedKeys, just in case) should solve the issue.

I will submit a PR now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions