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
[webview_flutter] Input needs to be tapped twice to be registered on Samsung devices #35867
Comments
I have same question.This problem arises because I need to new a webview to open new window for logining facebook.My flutter version is 1.7.11. |
@jyp334 @luckmlc flutter doctor -v (base) kylewong@KyleWongs-MacBook-Pro example % flutter doctor -v
[!] Flutter (Channel master, v1.8.2-pre.33, on Mac OS X 10.15 19A501i, locale en-CN)
• Flutter version 1.8.2-pre.33 at /Users/kylewong/Codes/Flutter/flutter
• Framework revision e3ee5c6bbb (2 days ago), 2019-07-13 16:02:09 -0700
• Engine revision 919e353236
• Dart version 2.5.0 (build 2.5.0-dev.1.0 24725a8559)
✗ Downloaded executables cannot execute on host.
See https://github.com/flutter/flutter/issues/6207 for more information
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.0)
• Android SDK at /Users/kylewong/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.0)
• Xcode at /Applications/Xcode-beta.app/Contents/Developer
• Xcode 11.0, Build version 11M337n
• CocoaPods version 1.7.3
[!] iOS tools - develop for iOS devices
✗ Verify that all connected devices have been paired with this computer in Xcode.
If all devices have been paired, libimobiledevice and ideviceinstaller may require updating.
To update with Brew, run:
brew update
brew uninstall --ignore-dependencies libimobiledevice
brew uninstall --ignore-dependencies usbmuxd
brew install --HEAD usbmuxd
brew unlink usbmuxd
brew link usbmuxd
brew install --HEAD libimobiledevice
brew install ideviceinstaller
• ios-deploy 1.9.4
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 3.4)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 36.1.1
• Dart plugin version 183.6270
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
[✓] VS Code (version 1.36.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.2.0
[✓] Connected device (3 available)
• PBCT10 • 80790da • android-arm64 • Android 8.1.0 (API 27) git@github.com:flutter/plugins.git is at commit: 518c8f0 |
I switched the Master version and the text entered still doesn't display.
|
@luckmlc |
Maybe Samsung mobile phones have this problem,I tried two Samsung phones. The problem may be that it won't get the focus for the first time , you need to click the input box again. Please see the gif below: flutter: Channel master, v1.8.2-pre.42 My environment is as follows:
|
Samsung mobile phones have this problem,huawei and meitu phones is ok! |
@kangwang1988 Hi , I just want to create a new window to complete the login function of facebook . My flutter version is 1.7.11 dev , This is my code to create a new window,In this new webview, the pop-up box is unable to pop up or cannot enter characters after it pops up. @Override
public boolean onCreateWindow(WebView view, boolean isDialog,
boolean isUserGesture, Message resultMsg) {
Log.d(TAG, "onCreateWindow");
mWebviewPop = new WebView(mContext);
mWebviewPop.setVerticalScrollBarEnabled(false);
mWebviewPop.setWebChromeClient(this);
mWebviewPop.setWebViewClient(new FacebookWebviewClient());
WebSettings settings = mWebviewPop.getSettings();
settings.setDomStorageEnabled(true);
settings.setJavaScriptEnabled(true);
settings.setSupportMultipleWindows(true);
settings.setJavaScriptCanOpenWindowsAutomatically(true);
mWebviewPop.setFocusable(true);
mWebviewPop.requestFocus(View.FOCUS_DOWN);
mWebviewPop.requestFocusFromTouch();
mWebviewPop.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT));
webView.addView(mWebviewPop);
CookieManager cookieManager = CookieManager.getInstance();
cookieManager.setAcceptCookie(true);
WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj;
transport.setWebView(mWebviewPop);
resultMsg.sendToTarget();
return true;
} '' |
@jyp334 |
@luckmlc |
I can reproduce the issue with a Galaxy S6 and the latest version of Flutter and the plugin. I haven't investigated in detail yet, but this looks exactly like the previous failure from when lock and unlocking were needed but not added yet. /cc @amirh |
@amirh and I looked into this a little offline. The problem appears to be where we restart the input connection on unlock. On Samsung devices this resets the We don't have a good idea for a fix yet. Working theory is that hopefully we can figure out some other way to correctly set |
Investigated this more today. So far I've been unable to find any state that differs between Samsung and non Samsung devices here, or any alternative ways to correctly set the window state in non Samsung devices. The flow goes like this:
At no point in any of these steps is there an obvious difference between Samsung and other phones' focus, windowFocus, rootView#focus, rootView#windowFocus, or any of the IMM getters. I think I may be able to hack around this and put in some logic like "if we've just restarted and we're about to return null from |
I have the same problem on huawei and MI devices only when I use Baidu input method, other input method works well. |
Same issue here but not just Samsung devices also MI And after the keyboard does not hide after the input confirmation |
Similar issue on Samsung device. But first at first tap input gets focus but keyboard does not show up. On second tap keyboard shows up and input is displayed. Android toolchain - develop for Android devices (Android SDK version 29.0.1) [✓] Android Studio (version 3.4) [!] IntelliJ IDEA Ultimate Edition (version 2019.1) [✓] Connected device (1 available) |
@mklim tried webview_flutter on issues is not solved. Nothing changed. |
@pedrosalesmiranda thanks for the report. Just to be clear, are you still seeing needing to tap twice for the soft keyboard to appear specifically? The keyboard not dismissing itself after unfocusing a text field is a different issue still open at #36478. Unfortunately I don't have that specific device to test with myself at the moment. |
@mklim you are welcome. I only tested 0.3.11+2 in MI device and in this case the issue was: This device is what I have with me all the time. Do you want some kind of special logs or some video of the bug happening or something that I can help you hunt the bug? We have a project that cant move forward while this happens. Actually we tested with webview on androind wihtout flutter and it worked. So might be a solution for us. But I really wanted to go on with flutter. |
@mklim |
@pedrosalesmiranda yeah, I think a new issues makes sense. I think whatever is happening here is probably specific to the Mi device. Filed #39451. If you see this reproing on any other devices or Android versions, that would be really helpful to know too. |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Edit by @mklim: Comment-511798199 found the Samsung issue. The first few comments in the chain refer to earlier versions of Flutter without any keyboard support at all. Quoting the relevant comment below.
Run the example in the webview_flutter plugin.
When I typed on the pop-up keyboard, the text I entered was not displayed.
Please see the gif below:
flutter 1.7.8
webview_flutter 0.3.9+1
My environment is as follows:
The text was updated successfully, but these errors were encountered: