EddyVerbruggen / cordova-plugin-actionsheet

:clipboard: ActionSheet plugin for Cordova iOS and Android apps
208 stars 71 forks source link

Actionsheet breaks virtual keyboard. #27

Closed GirlBossRush closed 8 years ago

GirlBossRush commented 8 years ago

Given an iOS app with a text input, tap the input. The virtual keyboard appears.

If an actionsheet is opened, all inputs will require two taps, one to focus and another to make the virtual keyboard appear. This behavior will persist until the app is restarted.

I've observed this bug on iOS 8 and 9.

Thank you!

patuku-roy commented 8 years ago

Almost the same problem with #26 ... actionsheet breaks virtual keyboard events

EddyVerbruggen commented 8 years ago

@TeffenEllis is it possible to create a little sample project replicating this? I'd love to investigate it but I can't reproduce it with my iPhone6S nor virtual iPad2 running iOS8 and 9.

GirlBossRush commented 8 years ago

I believe I've found the root of the issue. A combination of the actionsheet plugin and the TapToScroll plugin result in all inputs requiring two taps.

  1. Clone https://github.com/TeffenEllis/cordova-actionsheet-test
npm install
./node_modules/.bin/cordova platforms add ios
./node_modules/.bin/cordova build
  1. Open Xcode, build project. Tap an input once, keyboard appears. Tap "Open actionsheet", tap any choice, dismiss alert. Tap input again, keyboard does not appear.

I apologize for bringing up bugs that are occurring in another plugin. I'm not familiar with the specifics, but I've determined commenting out this line fixes the issue. How it, actionsheets, and the keyboard are related, I'm unsure.

https://github.com/TeffenEllis/cordova-actionsheet-test/blob/master/plugins/com.phonegap.TapToScroll/src/ios/TapToScroll.m#L48 https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIView_Class/#//apple_ref/occ/instp/UIView/hidden

Thank you!

patuku-roy commented 8 years ago

@EddyVerbruggen @TeffenEllis any luck?

EddyVerbruggen commented 8 years ago

Sorry never found the time. @TeffenEllis thanks for the excellent demo app!

I was able to confirm the issue on iOS 8.4 (simulator), and also saw it is fixed on 9.2 (both Simulator and Device).

I also noticed that if you don't alert the selected actionsheet option the keyboard may appear again after two taps. The webview doesn't scroll up though.

Since this plugin doesn't use any special iOS trickery and indeed commenting that line you highlighted fixes the issue for me as well I am convinced this is something the other plugin causes. Could you please open a plugin in their repo if you haven't already done so?