Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyboard height is inconsistent #2205

Closed
TheotimeColin opened this issue Oct 9, 2024 · 3 comments
Closed

Keyboard height is inconsistent #2205

TheotimeColin opened this issue Oct 9, 2024 · 3 comments

Comments

@TheotimeColin
Copy link

Bug Report

Plugin(s)

@capacitor/keyboard: 6.0.0

Capacitor Version

Latest Dependencies:
  @capacitor/cli: 6.1.2
  @capacitor/core: 6.1.2
  @capacitor/android: 6.1.2
  @capacitor/ios: 6.1.2

Installed Dependencies:
  @capacitor/cli: 6.1.2
  @capacitor/core: 6.0.0
  @capacitor/ios: 6.1.2
  @capacitor/android: 6.1.2

Platform(s)

Android 14

Current Behavior

keyboardHeight from Keyboard eventListener reports inconsistent values. When I click on an input, the height can be correct, much inferior to the actual height or 0. It seems be basically random.

This did not happen before (maybe an Android update?). I'm using the default keyboard on a Google Pixel.

Expected Behavior

keyboardHeight returns the correct keyboard height.

Code Reproduction

export const initKeyboard = () => {
  const onShow = (info: KeyboardInfo) => {
    console.log('KHEIGHT : ', info.keyboardHeight)
    // Logs 383 (correct), 48 (incorrect) or 0 (incorrect)

    height.value = info.keyboardHeight
  }

  if (Capacitor.isPluginAvailable('Keyboard') && Capacitor.isNativePlatform()) {
    Keyboard.addListener('keyboardWillShow', info => onShow(info))
    Keyboard.addListener('keyboardDidShow', info => onShow(info))
  }

  return { onShow, onHide }
}
@Ionitron
Copy link
Collaborator

This issue needs more information before it can be addressed.
In particular, the reporter needs to provide a minimal sample app that demonstrates the issue.
If no sample app is provided within 15 days, the issue will be closed.

Please see the Contributing Guide for how to create a Sample App.

Thanks!
Ionitron 💙

@Ionitron
Copy link
Collaborator

Ionitron commented Nov 1, 2024

It looks like this issue didn't get the information it needed, so I'll close it for now. If I made a mistake, sorry! I am just a bot.

Have a great day!
Ionitron 💙

Copy link

ionitron-bot bot commented Nov 16, 2024

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 the plugin, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Nov 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants