Disable scroll ionic ios9 Not working

Thanks for the tip towards padding being applied to the <scroll-content> directive, @matthewhw1989. It was the last puzzle piece I needed to make sense of all this keyboard related content movement.

There are two systems potentially interested in moving content out of the way when the soft keyboard is opened: the underlying native browser and the Ionic2 library itself.

  1. Keyboard.disableScroll(false) (available via the “ionic-plugin-keyboard” cordova plugin) successfully stops the native browser from pushing/scrolling the content pane up and allows the keyboard to slide over and cover existing content.

  2. Under Ionic2 defaults, however, there are systems in place attempting to both compensate for the keyboard slideover by adding padding to the bottom of your content (‘scrollAssist’) and to keep the focused input element within the viewport by scrolling back to it (‘autoFocusAssist’).

(There is currently an additional issue in that the scrollAssist padding is often not removed again after the keyboard goes away, leaving a new chunk of blank space. This is being tracked as ionic issue #5432: https://github.com/driftyco/ionic/issues/5432)

Fortunately, both scrollAssist and autoFocusAssist have nicely implemented switches in config that just don’t appear to have gotten public documented yet. In ionic-angular@2.0.0-beta.2 and up, one can customize these behaviors at any component level from globally across the App down to an individual input field by passing a config key into the component decorator:

@App({
    config: {
        scrollAssist: false,
        autoFocusAssist: false
    }
})

Full context of how to disable all keyboard space compensation for a whole Ionic2 app is shown in the app.ts gist linked below. I have personally tested this and seen the keyboard slide up over existing content without any pushing or scrolling in an Ionic2 (beta.3) app deployed to both iOS 9.2 and Android 6.0.

4 Likes