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

WKWebView is not resized properly after the native keyboard closes #2194

Open
drakedeatonuk opened this issue Sep 18, 2024 · 6 comments
Open

Comments

@drakedeatonuk
Copy link

Bug Report

Plugin(s)

@capacitor/keyboard 6.0.2

Capacitor Version

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

Platform(s)

ios & android

Current Behavior

Occasionally, when the keyboard closes, the webview doesn't resize. Instead it leaves a massive empty black space where the keyboard was. Even on subsequent opens & closes of the keyboard, the webivew then never resizes.

Expected Behavior

The webview should always resize to fill this space when the keyboard closed.

Code Reproduction

Unfortunately this issue is very hard to reproduce. I see it maybe once a week. The only pattern I've identified so far is that it seems to happen in low power mode on my iphone.

Screenshot 2024-09-18 at 06 17 14

Additional Context

I've seen this issue appear on several devices, and there seems to be at least one other ticket open on webview resizing issues (#831).

@drakedeatonuk
Copy link
Author

I believe the issue may also be linked to the native resize mode. Just a suspicion at this stage.... I've fully removed native resize mode use from the app and will report back if it seems to stop occurring.

@drakedeatonuk
Copy link
Author

Reporting back with my findings:

I removed any usage of the 'Native' resize mode, and in the week since I have not seen the issue I described in any devices. My team has tested several builds and we normally would've seen the issue a couple times by now.

I am certain the issue was being caused by my use of the native resize mode somehow.

@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 💙

@drakedeatonuk
Copy link
Author

By all means close this issue. I appreciate I can offer no reproduction. Hopefully if someone else has the same issue they can at least find this! 🙏

@cornelius-behrend
Copy link

Hey @drakedeatonuk, I'd run into a similar problem. While debugging I saw that the resize mode got changed while the keyboard was open. This results in the web view frame not being reset to its original size. Maybe you've encountered something similar. I've open this as an issue.

@drakedeatonuk
Copy link
Author

@cornelius-behrend very interesting I never even thought to test that! Maybe I'm not seeing it anymore then because I'm barely switching resize mode or even calling the change resize mode function now.

Well done finding a way to reproduce this bug. It was an issue for me for many months!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants