How to use scroll container for a list without using height property?

0
Hi experts, I am using one layout , inside that layout I have given one list view , there I need to use scroll-container for showing the list of data with scrollbar, but my requirement is that without giving any height property, list should be rendered. But In my case if I am not providing any height for that list-view, data is overflowing the layout . Any help would be appreciated.  
asked
1 answers
0

 I think you don't want to give height in pixels like 200px,


 In order for overflow to work on an element’s content, the element needs to have a definite measurement, otherwise, the element container will keep on expanding to accommodate as many content elements it can have or no matter the content’s size. 


But if the container element has a set height once its content reaches those limits, it will follow the overflow rule, which in case of scroll.
 
 You can try using below code
 
 overflow-x: hidden;
 overflow-y: scroll;
 height: 40vh;

(vh - Viewport Height (Auto adjusts according to browser's window size))
 
 Hope it Helps
 

answered