NiceGUI: Always show main scrollbar
NiceGUI is a modern web GUI for Python with fantastic documentation.
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:
ui.query("html").style("overflow-y: scroll;")