Skip to content

bug: keyboard events listens on visual viewport when in capacitor/cordova #27558

Closed

Description

@XStarlink

Prerequisites

Ionic Framework Version

v7.x

Current Behavior

  • Clicking between different inputs (opens the keyboard)
  • keyboard.isOpen does not work, it detects the keyboard as closed when it is open

Reproduction video:
https://github.com/ionic-team/ionic-framework/assets/34127019/c7449a79-f040-47af-bae1-1612e7c22291

Expected Behavior

  • Clicking between different inputs (opens the keyboard)
  • keyboard.isOpen detects the actual state of the keyboard, regardless of the action that occurred previously

Steps to Reproduce

  • Create a page with some ion-inputs
  • Add const { isOpen } = useKeyboard() to the page
  • Build for iOS
  • Click between inputs and see that isOpen does not work as expected

Code Reproduction URL

https://github.com/XStarlink/ionic-keyboard-issue

Ionic Info

Ionic:

Ionic CLI : 7.0.0 (/usr/local/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/vue 7.0.5 (/Users/quentin/Code/app/node_modules/.pnpm/@Ionic[email protected]/node_modules/@ionic/vue)

Capacitor:

Capacitor CLI : 5.0.1
@capacitor/android : 5.0.1 (/Users/quentin/Code/app/node_modules/.pnpm/@capacitor+android@5.0.1_@capacitor[email protected]/node_modules/@capacitor/android)
@capacitor/core : 5.0.1 (/Users/quentin/Code/app/node_modules/.pnpm/@capacitor[email protected]/node_modules/@capacitor/core)
@capacitor/ios : 5.0.1 (/Users/quentin/Code/app/node_modules/.pnpm/@capacitor+ios@5.0.1_@capacitor[email protected]/node_modules/@capacitor/ios)

Utility:

cordova-res : not installed globally
native-run : not installed globally

System:

NodeJS : v16.15.0 (/usr/local/bin/node)
npm : 8.5.5
OS : macOS Unknown

Additional Information

Reproduction video:
https://github.com/ionic-team/ionic-framework/assets/34127019/c7449a79-f040-47af-bae1-1612e7c22291

First part of the video:
I click between inputs, and isOpen see the keyboard as closed
Second part:
I click inside an input, then outside, several times, and isOpen works.

No response

Activity

  1. self-assigned this
    on May 30, 2023
  2. changed the title [-]bug: keyboard.isOpen does not work when clicking between different inputs (Vuejs)[/-] [+]bug: keyboard events listens on visual viewport when in capacitor/cordova[/+] on May 30, 2023
  3. added
    package: core
    type: bug
    on May 30, 2023
  4. liamdebeasi commented on May 30, 2023

    @liamdebeasi
    Contributor

    Thanks for the report. Here is a dev build with a proposed fix if you are interested in testing:

    7.0.10-dev.11685454286.186b37c5
    

    I see you are using @nuxtjs/ionic, so you may need to override the child dependencies to get the dev build to install correctly.

    In your package.json:

    "overrides": {
        "@nuxtjs/ionic": {
          "@ionic/vue": "7.0.10-dev.11685454286.186b37c5",
          "@ionic/vue-router": "7.0.10-dev.11685454286.186b37c5"
        }
      }
  5. removed their assignment
    on May 30, 2023
  6. ionitron-bot commented on Jun 30, 2023

    @ionitron-bot

    Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

  7. locked and limited conversation to collaborators on Jun 30, 2023
  8. added a commit that references this issue on Jan 26, 2024
    7871210
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    package: coretype: bug

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions