Sam Hooke

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;")

These are rough notes from whatever I was working on, interested in or thinking about at the time. They vary greatly in quality and length, but prove useful to me, and hopefully to you too!

← Previous: Poetry: Fixing permission error when upgrading dulwich
Next: NiceGUI: Show a confirmation popup →