NiceGUI: Always show main scrollbar
All notes in this series:
- NiceGUI: Always show main scrollbar
- NiceGUI: Show a confirmation popup
- NiceGUI: File upload and download
- FastAPI: Pretty print JSON
- NiceGUI with Click, Poetry, auto-reload and classes
- NiceGUI: tkinter error when updating pyplot
- NiceGUI: Bind visibility to arbitrary value
- NiceGUI: Change threshold for binding propagation warning
- NiceGUI with async classes
In a NiceGUI application, it can be annoying if the main vertical scrollbar appears and disappears depending upon whether there is more content than fits in the screen. This issue is of course not unique to NiceGUI, but just part of how HTML styling works by default.
Fortunately the fix is well-known: you just need to add the CSS overflow-y: scroll;
to the html
or body
element.
In NiceGUI, you can do this as follows: