3

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

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 '18 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 – user2582622 Aug 12 '18 at 22:38
  • For SLDS - I know it is possible: lightningdesignsystem.com/components/menus/#Submenu-to-Right – Itai Shmida Aug 13 '18 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 '18 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 – Itai Shmida Nov 25 '18 at 7:33

Your Answer

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

Browse other questions tagged or ask your own question.