-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
In iOS version 17.2, when moving the input focus in a WebView, an unknown area appears at the top of the screen. #1947
Comments
NOTE: This comment is auto-generated. Are you sure you have already searched for the same problem? Some people open new issues but they didn't search for something similar or for the same issue. Please, search for it using the GitHub issue search box or on the official inappwebview.dev website, or, also, using Google, StackOverflow, etc. before posting a new one. You may already find an answer to your problem! If this is really a new issue, then thank you for raising it. I will investigate it and get back to you as soon as possible. Please, make sure you have given me as much context as possible! Also, if you didn't already, post a code example that can replicate this issue. In the meantime, you can already search for some possible solutions online! Because this plugin uses native WebView, you can search online for the same issue adding Following these steps can save you, me, and other people a lot of time, thanks! |
Same on iOS 17.2.1. |
use latest version 6.0.0 |
@mohammedX6 |
Same on iOS 17.3 beta |
A smaller html file to reproduce this problem <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0,viewport-fit=cover"
/>
</head>
<body>
<div style="height: 100vh; overflow-y: auto">
<div>Focus in different inputs to reproduce the problem</div>
<input type="text" placeholder="focus me first" /> <br />
<input type="text" placeholder="then focus me" /> <br />
<button>hide keyboard</button>
<div style="height: 1000px"></div>
</div>
</body>
</html> |
I think I can help you because I have faced strange focus behavior when a virtual keyboard appears, and I managed to find a solution that rid me of 99% of all problems, and it was always related to the SafeArea widget. Looking at its parameters, I found one called |
@RMatushkin Is |
Related flutter issue: flutter/flutter#140501 |
@hexh250786313 I don't see any issues on my side. Here is my environment:
And this is how I use InAppWebView:
753728e3-448a-42dd-87e4-d32b6e5f4c79.mp4 |
Dear @RMatushkin |
I think I understand the problem. Yes, indeed, the bottom button is now completely blocked by my keyboard. My solution doesn't work, sorry. |
I tested the behavior in the Safari browser on a physical device. There behavior is exactly as I showed in the video above. Therefore, this behavior is standard. And in order to achieve the behavior that the author expects, it is necessary to write code and handle the keyboard, this is not a bug in the current WebView plugin. @hexh250786313 Could you please check how your page works in Safari on a physical device or simulator? You will be able to understand where the problem is in the WebView and where this is normal behavior. |
@RMatushkin Ty for your nice explanation, but I'm afraid I still don't know what happened. I am working on other projects recently and I don't have time to investigate this issue. My team decided to wait for the flutter official response. I will try to figure it out when I have time. Awesome thanks for your help anyway. |
@RMatushkin It does appear that in the video you are using IOS version 17.0, not 17.2, which this bug doesn't appear to happen on. |
I mentioned above that the same behavior occurs in the Safari browser on a physical device with iOS version 17.2.1, when the keyboard covers the button. Could you please check this behavior on physical device in Safari? |
Could you please check the behaviour on physical device in Safari? It seems like it's default behaviour in Safari, so I think we shouldn't expect another behaviour in WebView. As I wrote above, we have to write some part of the code to have this expected behaviour that described in this topic. |
same issue |
This problem havn't been resolved till now. |
…us in a WebView, an unknown area appears at the top of the screen.
I have reproduced and tested the issue, and it seems to be an iOS-specific problem. cause : There's a part where scrollView.adjustedContentInset is applied to scrollView.contentInset. When the keyboard appears, the bottom value of contentInset becomes negative. In this scenario, if another input box is tapped, UIScrollView.contentOffset momentarily takes on the value that was applied to scrollView.contentInset. solve : This is a temporary solution, but restoring scrollView.contentOffset in the aforementioned scenario resolves the issue for now. I've forked the repository and applied the fix there. Fiile : pubspec.yaml
It's a temporary fix, hopefully a permanent solution is found soon! |
Same problem |
I finally found a workaround to fix this. |
Released new version |
Environment
Device information:
Description
Expected behavior:
When moving the keyboard focus, there should be no unknown area appearing at the top of the screen
Current behavior:
In iOS version 17.2, when moving the keyboard focus, an unknown area appears at the top of the screen
Steps to reproduce
In iOS version 17.2, when moving the input focus in a WebView, an unknown area appears at the top of the screen.
Please refer to the video.
I am aware that setting 'resizeToAvoidBottomInset' of the scaffold to false prevents the UI from being resized by the keyboard, so the issue is not reproducible.
However, I want the bottom button to be positioned above the keyboard when the body size changed.
This issue is not reproducible on Android, and it occurs only on iOS version 17.2.
I believe this may be an issue on the Flutter side due to the OS version update. Your thoughts on this matter are appreciated.
I observed different behaviors based on the iOS version when testing with the same code.
I released an app that implemented the sign-up screen in that way, but after the OS upgrade, the issue mentioned above is occurring
I am using Flutter InAppWebView, and the result is the same when using Flutter WebView
flutter_inappwebview: ^5.7.2+3
Images
[Dart code]
[WebCode]
Stacktrace/Logcat
The text was updated successfully, but these errors were encountered: