How to remove the scrollbar in an ionic page

Hello,

I’m developing a login page and i want to remove the scrollbar, any idea on how to make that happend?
I tried to adda class to ion-content : <ion-content class="bg-image scroll">

and I applied this css code :

 .scroll {
        overflow: hidden;
    }

But it doesn’t work.
Any idea please? Thank you.

Try:

@ViewChild(Content) content: Content;

...

this.platform.ready().then(() => {
  this.setDisableScroll(true);
}

private setDisableScroll(disable: boolean) : void {
  let scroll = this.content.getScrollElement();
  scroll.style.overflowY = disable ? 'hidden' : 'scroll';
}
1 Like

Hey Rob. I so appreciate your answer. I does work.

I put setDisableScroll(true) like below

ionViewDidLoad() {
        this.setDisableScroll(true);
  }

I tried so many different css hacks tp prevent scroll and none really worked well for me.

Thanks again!