Deriving from the case where a page jumps due to the introduction of a vertical scroll bar (as described here), I've decided to always display the bar with html { overflow-y: scroll !important; }
, and not use a script listening for and changing window/document width. I'm thinking that styling the bar as completely transparent and button-less after page load (upon detection of the bar), giving it the appearance that there is no scrollbar, is another alternative. I've read that replacing RootPanel
with RootLayoutPanel
may also assist in this case, though that's out of the question in this specific instance.
How would I style the current native vertical scroll bar while avoiding the use of another wrapper panel or custom bar of any sort, as described here?
Here's how i'd detect a vertical scroll bar:
if( RootPanel.getBodyElement().getOffsetHeight() > Window.getClientHeight() )
//bar is present
I hope this restyle wouldn't be visible to a user.