bug: Keyboard shows after Keyboard.hide()
See original GitHub issueBug Report
Capacitor Version
Latest Dependencies:
@capacitor/cli: 2.4.2 @capacitor/core: 2.4.2 @capacitor/android: 2.4.2 @capacitor/electron: 2.4.2 @capacitor/ios: 2.4.2
Installed Dependencies:
@capacitor/cli 2.4.2 @capacitor/android 2.4.2 @capacitor/core 2.4.2 @capacitor/ios 2.4.2 @capacitor/electron not installed
[success] Android looking great! 👌 Found 2 Capacitor plugins for ios: @capacitor-community/native-audio (0.1.3) phonegap-plugin-barcodescanner (8.1.0) [success] iOS looking great! 👌
Platform(s)
- iOS
Current Behavior
Calling Keyboard.hide() hides the keyboard. Clicking any item (for example ion-item or ion-button in the toolbar) on the page triggers the keyboard to show again.
Expected Behavior
Keyboard should not show again when clicking on items like ion-button or ion-item.
Code Reproduction
...
<ion-toolbar>
<ion-buttons slot="start">
// Makes the Keyboard appear again after .hide() call before
<ion-button (click)="dismissModal(false)">Cancel</ion-button>
</ion-buttons>
</ion-toolbar>
...
...
<ion-searchbar showCancelButton="focus" cancelButtonText="Abbrechen" (ionCancel)="queryAccounts('')"
(search)="queryAccounts($event.target.value)" animated placeholder="Search" enterkeyhint="search"
type="search">
</ion-searchbar>
...
async queryAccounts(queryTxt: string) {
if (Capacitor.isNative) {
// Hide Keboard after search
await Keyboard.hide();
}
}
https://github.com/B30L/keyboard
Other Technical Details
npm --version
output:
6.14.8
node --version
output:
v12.19.0
pod --version
output (iOS issues only):
Ignoring ffi-1.12.2 because its extensions are not built. Try: gem pristine ffi --version 1.12.2
1.9.1
Additional Context
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:9
Top GitHub Comments
I am also having this problem, would really appreciate a fix or any kind of workaround.
It definitely gives off a very unprofessional and unpolished look.