13

This is done automatically when I load my website in iOS Safari and Chrome, but not done when I load it in cordova. I'd prefer a non-JS solution if possible.

Loren
  • 13,903
  • 8
  • 48
  • 79
  • What do you mean by non-JS? How do you want to achieve it without script? – MatiK Apr 02 '15 at 10:19
  • Ideally there would be some way to tell iOS to treat keyboard opening in UIWebView just like keyboards in Safari. If that's not possible, then a JS solution is fine. – Loren Apr 02 '15 at 20:41
  • Eg on Android it's a setting: http://developer.android.com/guide/topics/manifest/activity-element.html#wsoft – Loren Apr 16 '15 at 00:26

1 Answers1

3

Use: https://github.com/driftyco/ionic-plugins-keyboard

with:

window.addEventListener 'native.keyboardshow', (e) ->
  cur_height = $('body').height()
  $('body').height cur_height - e.keyboardHeight

window.addEventListener 'native.keyboardhide', (e) ->
  $('body').height '100%'
Loren
  • 13,903
  • 8
  • 48
  • 79