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;
this.ionContent.getScrollElement()
.then((div) => {
div.style.overflowY = 'scroll';
})
thanks!