Unable to use a "Hardware" keyboard on an ion-input (iOS simulator)
See original GitHub issueIonic version: (check one with “x”) [ ] 1.x [x] 2.x
I’m submitting a … (check one with “x”) [x] bug report [ ] feature request [ ] support request
Current behavior:
I am unable to utilise the “hardware” keyboard when deploying to the iOS simulator which uses an ion-input
(in this instance, the hardware is the MacBook’s keyboard).
I gather this may well be related to the ionic-plugin-keyboard
plugin.
If I uncheck this so the simulator is forced to use the software keyboard, I can focus and type, but this is somewhat painstaking. 🙂
But when I attempt to set focus by clicking, focus is immediately lost and I am unable to type.
Expected behavior:
To be able to use the hardware keyboard, and type without the ion-input
losing focus.
Steps to reproduce:
- Generate an Ionic v2 project:
ionic start -t blank -v IonInputTest && cd IonInputTest
- Run the project on an iOS simulator:
ionic emulate
- Ensure the hardware keyboard is connected: Hardware | Keyboard | Connect Hardware Keyboard.
Related code:
I added this to the bottom of home.page
in the Ionic 2 blank starter app:
<ion-list>
<ion-item>
<ion-input></ion-input>
</ion-item>
</ion-list>
Other information: The input seems to momentarily focus - since if I hammer the mouse/keyboard then I can type a letter or two.
Ionic info:
Cordova CLI: 6.5.0
Ionic Framework Version: 2.0.0
Ionic CLI Version: 2.1.18
Ionic App Lib Version: 2.1.9
Ionic App Scripts Version: 1.0.0
ios-deploy version: 1.9.0
ios-sim version: 5.0.13
OS: macOS Sierra
Node Version: v6.9.4
Xcode version: Xcode 8.2.1 Build version 8C1002
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:10 (5 by maintainers)
Omg - after nearly a year of pain and misery pressing each individual key on the iOS simulator, I have found out my issue related to this bug!
The issue was related to Hardware | Keyboard | Toggle Software Keyboard (⌘ + K) - my guess it was disabled. Weirdly, this isn’t an issue in a Cordova, non-Ionic app. If you have Connect Hardware Keyboard disabled, the issue persists.
There is a bug in the simulator menu since it does not show a tick next to the option, so you have no way of knowing whether it’s enabled/disabled (it also appears disabled in the menu in some instances, unsure why). However, after enabling it via ⌘ + K, it became enabled - still no tick, but I can type!
For me it works fine on physical devices. Just not the simulator…