You need to sign in to do that
Don't have an account?

How to make a lightning:layoutItem scrollable?
I’ve got a layout containing two side-by-side layout items, each taking half of the screen. How do I make each layoutItem have its own scrollbar as opposed to one scrollbar for the whole layout?
I tried including divs with the slds-scrollable—y class, but no joy:
<div class="c-container">
<lightning:layout horizontalAlign="space">
<lightning:layoutItem flexibility="auto" padding="around-small" size="6">
<div class="slds-scrollable--y">
***LEFT-SIDE CONTENT HERE***
</div>
</lightning:layoutItem>
<lightning:layoutItem flexibility="auto" padding="around-small" size="6">
<div class="slds-scrollable--y">
***RIGHT-SIDE CONTENT HERE***
</div>
</lightning:layoutItem>
</lightning:layout>
</div>
Am I missing something obvious? Thanks!
- Randy
I tried including divs with the slds-scrollable—y class, but no joy:
<div class="c-container">
<lightning:layout horizontalAlign="space">
<lightning:layoutItem flexibility="auto" padding="around-small" size="6">
<div class="slds-scrollable--y">
***LEFT-SIDE CONTENT HERE***
</div>
</lightning:layoutItem>
<lightning:layoutItem flexibility="auto" padding="around-small" size="6">
<div class="slds-scrollable--y">
***RIGHT-SIDE CONTENT HERE***
</div>
</lightning:layoutItem>
</lightning:layout>
</div>
Am I missing something obvious? Thanks!
- Randy
example:
Component.cmp
Component.css
The "limitVert" css class is setting the lightning:layoutItem to 50vh Vertical Height and the Overflow Auto allows it to set the scroll bar. Let me know if you have questions and dont forget to mark best answer.
- Randy