cordova-plugin-ionic-keyboard icon indicating copy to clipboard operation
cordova-plugin-ionic-keyboard copied to clipboard

Unable to open keyboard when focusing programmatically on device

Open bhanu7755 opened this issue 7 years ago • 9 comments

Hi,

Can we open specific keyboard basing on input type?

For example, if I have input type “tel” or “number” I want to open Numpad instead of normal keyboard programmatically.

I face this problem in Android. I haven’t tested in iOS.

Thanks!!

bhanu7755 avatar Jul 11 '18 07:07 bhanu7755

Yeah you can do that!! here's a example: <ion-item><ion-input type="tel" placeholder="WhatEverYouWantToShow"></ion-input></ion-item> and you see that input type with "tel" option, diference between "tel" and "number" its based on the character in the keyboard

here 2 Screenshot!!

Input with "tel" image

input with "number" image

PD. input number maybe show different in Os this is from Android Studio Simulator with Oreo 8.1 keyboard PD2. Tested in both Os's

wolfblazer avatar Jul 17 '18 13:07 wolfblazer

Hi @wolfblazer ,

Thanks for reply. Yes, you're right. it display keyboard when we run app in emulator but not on device. So, I created a new plugin which solves this problem

https://github.com/bhanu7755/cordova-android-focus

bhanu7755 avatar Jul 27 '18 06:07 bhanu7755

@bhanu7755 that's Weird 😞 Because on device i Still get the same Keyboard Tested on >4.4 Android and iOS >11.3

wolfblazer avatar Aug 02 '18 15:08 wolfblazer

@wolfblazer No idea mate.. I still see alpha numeric keyboard instead of number keyboard even though I use input type as "tel" or "number"

bhanu7755 avatar Aug 07 '18 01:08 bhanu7755

perhaps this ticket should be redirected at adding the ability to explicitly specify the keyboard type to show...

for example, I have an interface where I need the user to enter an IP address, which is best with a numeric keypad (type="number"), but actually needs a different type because it's got 4 sections separated by full stops.

don't you guys think a feature like this would solve both this issue's problem as well as my own?

ZaLiTHkA avatar Jan 17 '19 10:01 ZaLiTHkA

So this is a feature request to add types to Keyboard.show() method (or a new method), right?

If not I don't understand the problem, if you manually focus on an input, the keyboard is show based on its type.

jcesarmobile avatar Aug 21 '19 17:08 jcesarmobile

Yes.. I wrote a plugin to get my job done https://github.com/bhanu7755/cordova-android-focus

bhanu7755 avatar Aug 23 '19 06:08 bhanu7755

Based on that plugin description, it doesn’t seem to do what you were asking here or I didn’t understand it right.

jcesarmobile avatar Aug 23 '19 07:08 jcesarmobile

just to chime in here with my two cents' worth: I still feel that this would be best solved if we could specify which keyboard to open by rules on the ion-input tag itself.

for example: <ion-input type="text" board-type="numeric"></ion-input> would apply the type="text" to the UI element it creates, while the keyboard that opens would show a numeric keypad.

with that said, I'm actually not sure if this would require any changes to this keyboard plugin directly though.. guess that depends on (a) where the ion-input component (directive??) is defined and (b) whether cordova-plugin-ionic-keyboard has a way for us to programmatically specify which keyboard interface we want to show.

ZaLiTHkA avatar Aug 23 '19 07:08 ZaLiTHkA