I want to open the dropdown as given https://www.lightningdesignsystem.com/components/menus/ ,when i click the button, here the dropdown stays open. At the bottom it's mentioned that for the same I'd have to restrict slds-dropdown-trigger_click, which I'm not sure how.


That menu is a lightning-button-menu component.

You can add one with this code:

<lightning-button-menu alternative-text="Show menu">
  <lightning-menu-item value="MenuItemOne" label="Menu Item One"></lightning-menu-item>
  <lightning-menu-item value="MenuItemTwo" label="Menu Item Two" disabled></lightning-menu-item>
  <lightning-menu-item value="MenuItemThree" label="Menu Item Three" disabled></lightning-menu-item>
  <lightning-menu-item value="MenuItemFour" label="Menu Item Four"></lightning-menu-item>
  • But what if i don't want to have that dropdown icon, how can i hide that? – Dustin Feb 11 '20 at 3:49
  • You can add an icon next to the down arrow but you can't hide the arrow in the Lightning base component. If you really want to hide it then you have to re-implement the base component from the SLDS menu HTML/JS blueprint. – POZ Feb 11 '20 at 9:03

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.