1
votes

I am trying build a UI with a VerticalPanel inside a ScrollPanel inside another VerticalPanel. I need the ScrollPanel to stretch to its parents height and width, so I set the height and width to 100%. The problem is, if the child VerticalPanel exceeds the size of the parent's, the ScrollPanel stretches to fit the child, beyond the limits of its parent.

Are there any CSS properties to limit the size of the ScrollPanel? I can't use maxHeight/maxWidth because I don't know the dimensions of the parent and would like to continue using "100%" as the width/height values.

Thanks!

2
I thing you can user the CSS "inherit" property to get the same properties of the parent - Hassen Ch.
Please have a look at this question. - Florent Bayle

2 Answers

3
votes

unfortunately, you can't set ScrollPanel sizes to percentage. If you want to set your scrollPanel height to client's view height, you have to manage its height on your code to Window.getClientHeight().

0
votes

You can not specify scrollpanel height in percentage. This should be absolute not relative. You have to modify your code and replace percentage to px or em but not percentage.

For more detail refer Scroll Panel Height