Suppress keyboard on input focus

My app is to run on a device with physical scanning buttons. With focus on a field the keyboard pops up which I want to hide as the scan process will provide input to the input field.

How can I hide the keyboard in Ionic 3?

Can I force the keyboard to show of screen perhaps? or maybe changing a value in config.xml will do it?

I’ve tried loads of things like … disable on input field, but that stops any input. readonly and coding a focus on input but that still shows keyboard. keyboard.close doesn’t work even if it’s in a setTimeout function.

Please help as this is doing my head in.

Wasn’t there a method to hide the keyboard, and subscribe to id appearing and disappearing? Maybe this can be used to cancel this out and make it seem hidden all the time.

I don’t know. Is there an id for the keyboard that I can interact with? I’ve tried subscribing to the keyboard.onKeyboardShow() and then do a keyboard.close() but I cannot get this working. Either way, you’d see the keyboard flash up which isn’t ideal.

I’ve also tried passing in the button click event from the view and then in the function call either event.preventDefault() or event.stopPropagation() and neither do anything.

Any other idea?

1 Like

Hi! Have you been able to solve this?