Sam Hooke

NiceGUI: Always show main scrollbar

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:

ui.query("html").style("overflow-y: scroll;")

See all notes.

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