I have a lightning:buttonMenu with a few lightning:menuItem and want to display a submenu when hovering over one of the options. Having a hard time understanding how to create a submenu.

Was thinking along the lines to have a lightning:buttonMenu nested inside a lightning:menuItem.

 <lightning:menuItem label="Testing" onmouseover="{!c.doSomething?}">
   <lightning:buttonMenu aura:id="test">
    <lightning:menuItem label="One"/>
    <lightning:menuItem label="Two"/>
    <lightning:menuItem label="Three"/>

Documentation : https://developer.salesforce.com/docs/component-library/bundle/lightning:buttonMenu/documentation

  • 1
    Does the nested <lightning:buttonMenu> open on a click of the containing <lightning:menuItem>?
    – Keith C
    Aug 10, 2018 at 22:44
  • No, it doesn't. Maybe you can't have submenus inside lightning:buttonMenu because in the documentation hover is not supported. Only attributes it supports are onFocus and onBlur Aug 12, 2018 at 22:38
  • For SLDS - I know it is possible: lightningdesignsystem.com/components/menus/#Submenu-to-Right Aug 13, 2018 at 6:05
  • Is not there any solution yet? @ItaiShmida I have seen also this, however, I cannot see lightning codes to produce this menu.
    – efirat
    Nov 22, 2018 at 8:39
  • 1
    @efirat If you want me to help - try the SLDS example that I have linked, if it is not working, write a question with the code that you have tried, then I can try to help you with it Nov 25, 2018 at 7:33


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy