Ionic 4: ion-content "Always show scrollbar"

It appears that ion-content element can accept a “scroll-y” attribute which turns on “overflow-y: auto” for the inner div which actually gets the scrollbar. But, I am looking for a simple way to get behavior of “always show the scrollbar”. (Because of the classic problem of seeing content jump horizontally when switching between pages that have / don’t have scrollbar. It is more noticeable on a desktop situation where the app is contained in a narrower width than the full screen, e.g. how facebook looks on desktop).

I can force it by setting the style of the DOM element like the following, but wondering if I am missing a simpler method. (I see there is a css custom property called “–overflow”, but did not succeed in setting that in an effective manner.)

@ViewChild('ionContent') ionContent: IonContent;

        .then((div) => {
 = 'scroll';


Not sure of any way to force the scrollbar to always be visible with just CSS/JS. I know there are some system settings that for you machine that you can toggle, but there’s nothing from a browser’s perspective that could handle this.

In this case, I don’t suggest doing anything really. Other wise, you could be causing more issues than solving.

Setting “overflow-y: scroll” in CSS does work; Was just looking for cleaner way to set this in ion-content;
Above DOM hack workaround worked OK though.