question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: Keyboard shows after Keyboard.hide()

See original GitHub issue

Bug 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:open
  • Created 3 years ago
  • Reactions:4
  • Comments:9

github_iconTop GitHub Comments

2reactions
oskarlatussekcommented, Jan 13, 2021

I am also having this problem, would really appreciate a fix or any kind of workaround.

2reactions
selected-pixel-jamesoncommented, Dec 12, 2020

It definitely gives off a very unprofessional and unpolished look.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android show view and hide keyboard at same time. Weird ...
I have checked the Github project and found the bug and I have fixed that bug with the following code:
Read more >
ios 14 keyboard not appearing | Apple Developer Forums
keyboard does not appear when responding to email. cant type anything. if a response box appears - as in messages - keyboard does...
Read more >
Problem after hiding the keyboard - Android physical device
Seems like the driver is trying to click the button on a “higher” coordinate, missing it, as if it thought the keyboard is...
Read more >
Full control with the VirtualKeyboard API - Chrome Developers
To hide the virtual keyboard, call the hide() method. The method always returns undefined but triggers a geometrychange event if the virtual ...
Read more >
Soft keyboard not showing up on request [36940911]
Expected result: After pressing Show Keyboard-button, the keyboard would always be visible. After pressing Hide Keyboard-button, the keyboard would always be ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found