Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Input focus will not trigger keyboard on Android #3115

Open
peterlindholm opened this issue Jun 17, 2020 · 2 comments
Open

bug: Input focus will not trigger keyboard on Android #3115

peterlindholm opened this issue Jun 17, 2020 · 2 comments

Comments

@peterlindholm
Copy link

Bug Report

Capacitor Version

💊   Capacitor Doctor  💊 

Latest Dependencies:
  @capacitor/cli: 2.2.0
  @capacitor/core: 2.2.0
  @capacitor/android: 2.2.0
  @capacitor/electron: 2.2.0
  @capacitor/ios: 2.2.0

Installed Dependencies:
  @capacitor/electron not installed
  @capacitor/cli 2.2.0
  @capacitor/core 2.2.0
  @capacitor/android 2.2.0
  @capacitor/ios 2.2.0

[success] Android looking great! 👌
  Found 0 Capacitor plugins for ios:
[success] iOS looking great! 👌

Platform(s)

Android

Current Behavior

On input focus the soft keyboard is not shown unless user has interacted with the webview before the focus event.

Expected Behavior

I would expect the soft keyboard to show on input focus. That is how it works on iOS.

On iOS it seems this behavior can be controlled with the KeyboardDisplayRequiresUserAction configuration. But I haven't been able to figure out how to do something similar for Android.

I know I can trigger the keyboard manually using the Capacitor keyboard plugin, but that way the input type (here number) will no be respected and the regular keyboard is shown.

Is this is expected behavior and if so is there anything we can do to override this?

Code Reproduction

Sample application for repro here:
https://github.com/peterlindholm/capacitor-keyboard

Other Technical Details

npm --version output: 6.14.5

node --version output: v12.12.0

@jcesarmobile
Copy link
Member

I think it was working in the past, at least since this was merged #2719, but doesn't seem to work anymore.
It's not working in cordova apps neither.

But testing in your app, if you first call focus and then use Capacitor.Plugins.Keyboard.show(), it shows the correct number keyboard, so you can do that as workaround.

@peterlindholm
Copy link
Author

peterlindholm commented Jun 18, 2020

Thank you for your response.

I was convinced that I didn't get it working for type="number", but just tried again and it does in fact seem to work. We'll be using that as a workaround for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants