Search code examples
cordovaxcode10ios12

Scroll view problem with ios12, xcode10, cordova 7.1, cordova-ios 4.5.4 on keyboard closing


I built a cordova app for iOS with Framework7 v2.3.1, using:

It works perfectly, but a few days ago I compiled the Cordova app for iOS with Xcode 10. On iOS 12 device, if the app is compiled with Xcode 10, when I select an input field the keyboard appears and the view scrolls up, but when the keyboard closes, the view doesn’t scroll down, the blank space of the keyboard remains. The problem there isn’t if I compile the app with Xcode 9.4 and I install it on a device with iOS 12, or if the app is compiled with Xcode 10 and installed on a device with iOS 11.x I uploaded a screenshot to explain better the problem Does anybody have a solution? Thanks

Steps to explain the problem on keyboard closing


Solution

  • Use this plugin https://www.npmjs.com/package/cordova-plugin-keyboard#keyboarddidhide

    or "cordova plugin add cordova-plugin-keyboard"

    Then just add this on deviceReady:

    Keyboard.automaticScrollToTopOnHiding = true;

    This works for me in ios12