Popover, background still scrollable

Managed to work around this issue by:

Adding the following in app.scss

ion-app.disable-scroll {
    ion-content>.scroll-content {
        overflow: hidden;
    }
}

In the popover/modal .ts file, add the following

    ionViewDidLoad() {       
        document.getElementsByTagName("ion-app").item(0).classList.add("disable-scroll");
    }    

    ionViewWillLeave(){
        if ( document.getElementsByTagName("ion-app").item(0).classList.contains("disable-scroll") )
            document.getElementsByTagName("ion-app").item(0).classList.remove("disable-scroll");
    }

Hope this helps.

Inspired from the idea suggested by longzheng in ionic2 - bug(backdrop?)

1 Like