react-multilevel-dropdown icon indicating copy to clipboard operation
react-multilevel-dropdown copied to clipboard

Clicking on child item within sub-menu triggers parent's callback

Open nav-mohan opened this issue 2 years ago • 0 comments

<Dropdown title='Dropdown title' position="right">
  {Object.keys(_g_lineage_tree).map(parent_lh=>
      <Dropdown.Item position="right" key={parent_lh} onClick={(e)=>console.log(parent_lh)}>
          {parent_lh}
          <Dropdown.Submenu position="right">
              {_g_lineage_tree[parent_lh].map(child_lh=>
                  <Dropdown.Item position="right" key={child_lh} onClick={(e)=>console.log(child_lh)}>
                  {child_lh}
                  </Dropdown.Item>
              )}
          </Dropdown.Submenu>
      </Dropdown.Item>
  )}
</Dropdown>

_g_lineage_tree is a JSON object containing the menu and sub-menu names. When I click on a sub-menu item it triggers the menu (parent) callback.

nav-mohan avatar Feb 05 '23 03:02 nav-mohan