Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
deleted 350 characters in body; edited title
Source Link
Robert Sösemann
  • 38.2k
  • 29
  • 173
  • 508

How can I config a button menu LWC inside a div Make lightning-button-menu work with overflow:hidden?

I´m struggling tryingIs there a way to useprevent that the builtbelow lightning-in button menu Lightning Web Component inside abutton-menu is hidden by the wrapping div which has aan overflow  : hidden. The opened menu is inside that div.?

Is there a way to modify or say to the component that it should float outside the container div?enter image description here

buttonMenuBasicbuttonMenu.html

<template>
    <div class="slds-m-top_medium slds-m-bottom_x-large">
        

        <!-- DIV CONTAINER WITH OVERFLOW -->
        <div class="slds-p-around_medium overflow-div">
            <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"></lightning-menu-item>
                <lightning-menu-item value="MenuItemThree" label="Menu Item Three"></lightning-menu-item>
                <lightning-menu-item value="MenuItemFour" label="Menu Item Four"></lightning-menu-item>
            </lightning-button-menu>
        </div>
    </div>
</template>

buttonMenuBasicbuttonMenu.css

.overflow-div {
    
    overflow: hidden;
    background-color: grey;

}

buttonMenuBasic.js

import { LightningElement } from 'lwc';

export default class ButtonMenuBasic extends LightningElement {}

Thanks in advance.

How can I config a button menu LWC inside a div with overflow:hidden?

I´m struggling trying to use the built-in button menu Lightning Web Component inside a div which has a overflow: hidden. The opened menu is inside that div.

Is there a way to modify or say to the component that it should float outside the container div?

buttonMenuBasic.html

<template>
    <div class="slds-m-top_medium slds-m-bottom_x-large">
        

        <!-- DIV CONTAINER WITH OVERFLOW -->
        <div class="slds-p-around_medium overflow-div">
            <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"></lightning-menu-item>
                <lightning-menu-item value="MenuItemThree" label="Menu Item Three"></lightning-menu-item>
                <lightning-menu-item value="MenuItemFour" label="Menu Item Four"></lightning-menu-item>
            </lightning-button-menu>
        </div>
    </div>
</template>

buttonMenuBasic.css

.overflow-div {
    
    overflow: hidden;
    background-color: grey;

}

buttonMenuBasic.js

import { LightningElement } from 'lwc';

export default class ButtonMenuBasic extends LightningElement {}

Thanks in advance.

Make lightning-button-menu work with overflow:hidden

Is there a way to prevent that the below lightning-button-menu is hidden by the wrapping div which has an overflow  : hidden?

enter image description here

buttonMenu.html

<template>
    <div class="slds-p-around_medium overflow-div">
        <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"></lightning-menu-item>
            <lightning-menu-item value="MenuItemThree" label="Menu Item Three"></lightning-menu-item>
            <lightning-menu-item value="MenuItemFour" label="Menu Item Four"></lightning-menu-item>
        </lightning-button-menu>
    </div>
</template>

buttonMenu.css

.overflow-div {
    overflow: hidden;
    background-color: grey;
}
Source Link

How can I config a button menu LWC inside a div with overflow:hidden?

I´m struggling trying to use the built-in button menu Lightning Web Component inside a div which has a overflow: hidden. The opened menu is inside that div.

Is there a way to modify or say to the component that it should float outside the container div?

buttonMenuBasic.html

<template>
    <div class="slds-m-top_medium slds-m-bottom_x-large">
        

        <!-- DIV CONTAINER WITH OVERFLOW -->
        <div class="slds-p-around_medium overflow-div">
            <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"></lightning-menu-item>
                <lightning-menu-item value="MenuItemThree" label="Menu Item Three"></lightning-menu-item>
                <lightning-menu-item value="MenuItemFour" label="Menu Item Four"></lightning-menu-item>
            </lightning-button-menu>
        </div>
    </div>
</template>

buttonMenuBasic.css

.overflow-div {
    
    overflow: hidden;
    background-color: grey;

}

buttonMenuBasic.js

import { LightningElement } from 'lwc';

export default class ButtonMenuBasic extends LightningElement {}

Thanks in advance.