Comment by vintagedave

Comment by vintagedave 8 days ago

6 replies

The trick to prevent scrolling by setting overflow: hidden unfortunately results in visual page jumping for me.

The reason is I have macOS set up to always show scroll bars, instead of hiding them. At least one browser (I forget which, but I test on Safari, Firefox and Chrome) doesn’t have a disabled scroll bar but removes it altogether. This makes the page wider and causes it to reflow and move.

Does anyone know how to keep the scroll bar onscreen, just not enabled?

andrewmcwatters 5 days ago

It's been a while since I've tested this, but an explicit overflow-y: scroll used to keep the scrollbar there, so that when you needed to change the property, the user-agent controls wouldn't pop in or out.

KTibow 8 days ago

Website authors can set a scrollbar gutter.