Skip to content

scroll area height "h-full" make the scroll area gone? #3079

Answered by falkoschindler
atticus-lv asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @atticus-lv,

"h-full" let's `ui.scroll_area" get the height from its parent container. But there is no such container. The page itself doesn't automatically fill the viewport, so it's height is 0 by default. If the scroll area uses this height as well, everything collapses to zero height.

You could use something like .classes('w-full h-[calc(100vh-2rem)]') to use 100% of the viewport minus 2rem for the padding. If there are other elements taking up some of the vertical space, you might want to force to page to fill the viewport before using "h-full" on the scroll area:

ui.context.client.content.classes('h-screen')

ui.label('Some text')
with ui.scroll_area().classes('w-full h-full'):
    

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@atticus-lv
Comment options

@atticus-lv
Comment options

@falkoschindler
Comment options

Answer selected by atticus-lv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants