You need to sign in to do that
Don't have an account?
Alex Miller 93
List of Components Scroll
Hi! I'm trying to figure out why my scroll functionality isn't behaving the way I want it to. I have this component sitting as the parent:
But I'm getting this result:
<aura:component implements="flexipage:availableForAllPageTypes" access="global" controller="ContentListController"> <aura:handler name="init" value="{!this}" action="{!c.doInit}"/> <!-- Global decleration for the Content Id selected --> <aura:attribute name="ContenList" type="Content__c[]"/> <!-- this section!! --> <div style="max-height: 400px;overflow-y: auto;"> <aura:iteration items="{!v.ContenList}" var="store"> <c:ContentCard content="{!store}" duration="1" /> </aura:iteration> </div> <!-- this section!! --> </aura:component>I'm loading a list of object records into this iteration. Then I'm wanting to contain them like the diagram shows where the list of components would be 5 or 6 cards visible at a given time. Then anything overflowing would require scrolling.
But I'm getting this result:
Greetings to you!
You can use ui:scrollerWrapper that enables native scrolling in Lightning Components Salesforce1 app as well as in Lightning Desktop.
A ui:scrollerWrapper creates a container that enables native scrolling in the Salesforce app. This component enables you to nest more than one scroller inside the container. Use the class attribute to define the height and width of the container. To enable scrolling, specify a height that's smaller than its content.
Component:
CSS:
Along with it, you can use SLDS class="slds-scrollable"
Please refer to the below links which might help you further with the above issue.
https://developer.salesforce.com/docs/component-library/bundle/ui:scrollerWrapper/documentation
https://www.lightningdesignsystem.com/utilities/scrollable/
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas