Ok, say I have a ScrollPanel with height="500px". There is a HTMLPanel inside that ScrollPanel.
Sometimes, the HTMLPanel has more content so it will be higher than "500px", ex: 700px. The other time, the HTMLPanel has less content so it will be shorter than "500px", ex: 300px.
When the HTMLPanel is higher than 500px, there is a scrollbar appeared. That's makes sense. No Issue.
However, the problem is when the HTMLPanel is shorter than 500px (ex, 300px), no scrollbar appeared, but the ScrollPanel still shows 500px in height. So there is 200px height gap left unused, & that is a waste of space & unacceptable.
Pls see this picture
So, How to make ScrollPanel only visible when its inside widget is higher than it & not visible when its inside widget is shorter than it?
Can we fix it via Css or coding?