Created
April 10, 2016 19:45
-
-
Save EvanWillms/8773f8cfa12f469fabf0bdd7a75723e7 to your computer and use it in GitHub Desktop.
Allow Ionic2 keyboard to open without pushing or scrolling content
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Minimum viable app.ts pulled from https://github.com/driftyco/ionic2-starter-blank/tree/41b4da8329636a95ab05d2579efd3a1527d2e830 | |
// This snapshot is likely [email protected] compatable | |
import 'es6-shim'; | |
import {App, Platform} from 'ionic-angular'; | |
import {StatusBar} from 'ionic-native'; | |
import {HomePage} from './pages/home/home'; | |
@App({ | |
template: '<ion-nav [root]="rootPage"></ion-nav>', | |
config: { | |
// These options are available in [email protected] and up. | |
scrollAssist: false, // Valid options appear to be [true, false] | |
autoFocusAssist: false // Valid options appear to be ['instant', 'delay', false] | |
} // http://ionicframework.com/docs/v2/api/config/Config/ | |
}) | |
export class MyApp { | |
rootPage: any = HomePage; | |
constructor(platform: Platform) { | |
platform.ready().then(() => { | |
// Okay, so the platform is ready and our plugins are available. | |
// Here you can do any higher level native things you might need. | |
StatusBar.styleDefault(); | |
if (window.cordova && window.cordova.plugins.Keyboard) { | |
// This requires installation of https://github.com/driftyco/ionic-plugin-keyboard | |
// and can only affect native compiled Ionic2 apps (not webserved). | |
cordova.plugins.Keyboard.disableScroll(true); | |
} | |
}); | |
} | |
} |
I am facing the same problem i.e. when keyboard is being opened my whole background pushes up along with keyboard.
I having following config:
Ionic/cli: 4.3.1
cordova-plugin-ionic-keyboard: 2.1.3
Kindly help me out for the same as above all tricks are not working for me.
Adding the following to config.xml fixed the issue for me (ionic v4.4.0):
<preference name="KeyboardResize" value="true" /> <preference name="KeyboardResizeMode" value="ionic" />
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We also have an issue in Android Browser (not cordova). Clicking an input quickly shows and hides the keyboard, not allowing user to enter enything. Help!