3

I have an application that needs to have two separate behaviours when the keyboard is shown:

  • Certain controls need to be hidden, for which purpose a keyboard show/hide event is required (a requirement discussed in this question, among others).
  • I need the web view to resize so that controls which are aligned with the bottom of the view remain visible (a requirement discussed in this question).

The common suggestion for the former is to use the ionic-plugin-keyboard plugin (despite this not being an ionic app), which provides events native.keyboardshow and native.keyboardhide that work in both iOS and Android for this purpose.

The common suggestion for the latter is to use the cordova-plugin-keyboard plugin, which provides both a preference that can be configured using config.xml and a method that controls the setting at runtime. While this plugin also includes events for detecting keyboard changes, these events are apparently only available under iOS, but I need my application to run on both iOS and Android.

Unfortunately, these two plugins are not compatible: both define the same javascript interface object (cordova.plugins.Keyboard), so only one can exist in a project at any time.

How can I get both of these behaviours working at the same time?

Jules
  • 14,841
  • 9
  • 83
  • 130

0 Answers0