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

Embedded Android views can't bring up the keyboard #19718

Closed
amirh opened this issue Jul 24, 2018 · 184 comments
Closed

Embedded Android views can't bring up the keyboard #19718

amirh opened this issue Jul 24, 2018 · 184 comments
Assignees
Labels
a: annoyance Repeatedly frustrating issues with non-experimental functionality a: platform-views Embedding Android/iOS views in Flutter apps c: new feature Nothing broken; request for a new capability customer: crowd Affects or could affect many people, though not necessarily a specific customer. customer: google Various Google teams engine flutter/engine repository. See also e: labels. framework flutter/packages/flutter repository. See also f: labels. p: webview The WebView plugin package flutter/packages repository. See also p: labels. platform-android Android applications specifically
Milestone

Comments

@amirh
Copy link
Contributor

amirh commented Jul 24, 2018

To make sure that Flutter can always bring up the keyboard I made the window of virtual display's presentation non focusable.
As a result the embedded Android views cannot bring up the keyboard.

We should figure out if there's some window trickery we can do to let the unfocused window bring up the keyboard. Alternatively see if it's possible to dynamically select the focused window when delivering input events.

@fujinjun
Copy link

fujinjun commented Dec 5, 2018

anyone solved this problem?

@zoechi zoechi added framework flutter/packages/flutter repository. See also f: labels. engine flutter/engine repository. See also e: labels. labels Dec 17, 2018
@zoechi zoechi added this to the Goals milestone Dec 17, 2018
@amirh amirh added c: new feature Nothing broken; request for a new capability plugin labels Jan 5, 2019
@bvedam
Copy link

bvedam commented Jan 16, 2019

Still seeing the issue on the following versions. Surprised to see this issue is still not resolved after 6 months.

compileSdkVersion = targetSdkVersion = 26 & 27

Tried both stable and beta channels.

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel beta, v1.0.0, on Microsoft Windows [Version 10.0.16299.847], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[√] Android Studio (version 3.2)
[√] VS Code, 64-bit edition (version 1.30.2)
[√] Connected device (1 available)

• No issues found!

Can someone respond with the status please. Thanks.

@amirh
Copy link
Contributor Author

amirh commented Jan 16, 2019

Since as far as I can tell there isn't a way for an Android app to dynamically change the focused window, and as only the focused window can bring up and use a keyboard, the only approach I see right now is to setup up some proxying mechanism for input connections which isn't trivial on it's own as non trivial trickery is required to figure out when a webview is asking for keyboard. Last I dug into this I had a somewhat complex plan which I haven't tested yet (if someone have a suggestion for a clean solution I'd be very happy to hear about it).

An alternative approach would be to use an iOS style platform view embedding mechanism when keyboard is needed (splitting the Flutter surface instead of rendering to a texture), this will have the drawback of not supporting all transforms (e.g if you'll opt in for keyboard support you will trade things like color filters, backdrop filter, perspective transforms and more).

All this to say that this is a non trivial effort, I do think it is important and will try to get it, but right now I'm focusing on finalizing and quality of the current set of platform views features.

@bvedam
Copy link

bvedam commented Jan 17, 2019

Thank you very much for detailing the problem in hand, and its complexity. Currently using flutter_inappbrowser plugin based that is based on AndroidView, which is why I have this problem. I initially used the flutter community plugin "flutter_webview_plugin" but that doesn't support setting cookies (inappbrowser does). Is there a web view plugin you could recommend that supports setting webview cookies and not have this keyboard issue. Appreciate your response.

@amirh
Copy link
Contributor Author

amirh commented Jan 18, 2019

I have no experience with webview plugins other than webview_flutter, you might have a better luck asking in one of the community channels: https://flutter.io/community

@Steve-sy
Copy link

Steve-sy commented Feb 7, 2019

Hello Guys, anyone solved this issue?

@alexelisenko
Copy link

alexelisenko commented Feb 11, 2019

Having the same issue with webview_flutter: ^0.3.0+2 on Android. Does anyone have any workarounds?

@Steve-sy
Copy link

Having the same issue with webview_flutter: ^0.3.0+2 on Android. Does anyone have any workarounds?

its really shame on flutter man! look at the issue its from Jul 24, 2018! @amirh any news can help us bro?

@amirh amirh added customer: crowd Affects or could affect many people, though not necessarily a specific customer. severe: customer critical labels Feb 12, 2019
@Hixie
Copy link
Contributor

Hixie commented Feb 13, 2019

@Steve-sy Please consider reading through https://github.com/flutter/flutter/blob/master/CODE_OF_CONDUCT.md at some point soon. Thanks! :-)

@ghost
Copy link

ghost commented Feb 15, 2019

In my app, when the WebView is showing, that is the only place there will ever be a need for a keyboard. In this scenario, the WebView is shown in full screen with a floating button to access settings and exit WebView.

This plugin is great compared to the others I've tried but I really need that keyboard on Android. My app also has components written in Flutter, with many more to be added soon, but because we have a web login, we can't get very far (literally nowhere) in our app without a keyboard!

Could we do something like a FullScreenWebView that DOES allow the window of virtual display's presentation to be focusable?

Thanks

@masewo
Copy link

masewo commented Jul 18, 2019

With version 0.3.10+3 of webview_flutter plugin and flutter on master channel it is now not possible anymore to copy and paste text from clipboard to input fields (tested on multiple Android 9 devices including emulator). Happens on multiple websites and also in the webview_flutter example app.

@mklim
Copy link
Contributor

mklim commented Jul 18, 2019

@pakyo-pan filed #36478 to track this, thanks.
@masewo thanks for the detailed info. That's currently being tracked in #24585.

@joelbrostrom
Copy link

joelbrostrom commented Aug 9, 2019

@masewo
I noticed the same thing.
I can add that double clicking text highlights it and brings up the option bar above it.
Pressing any one of cut/copy/paste closes the option bar and deselect the text but does not perform the action.

This is an important feature for any "look up" application.
Fix would be appreciated.

Just open google in a WebView to try it out:

import 'package:blk_birthday_flutter/utility/const.dart';
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';

void main() => runApp(
      MaterialApp(
        theme: appTheme,
        title: 'Birthday',
        home: Scaffold(
          body: WebView(
            initialUrl: 'https://google.com',
          ),
        ),
      ),
    );

@luffynas
Copy link

yeach, this issue still occurs, please read this #38668 (comment)

@honghuazhao
Copy link

After upgrading to webview_flutter 0.3.13 and Flutter 1.7.8 hotfix 4 stable, I can input text in normal textfield. But I still cannot input in password textfield. Could you please fix it? @amirh

@pythoneer
Copy link

@jameszhao-io can you please file a new issue, this one is closed!

@sldboy
Copy link

sldboy commented Aug 23, 2019

After upgrading to webview_flutter 0.3.13 and Flutter 1.7.8 hotfix 3 stable, I can input text in normal textfield. But I still cannot input in password textfield. me too.@jameszhao-io

@amirh
Copy link
Contributor Author

amirh commented Sep 10, 2019

@sldboy thanks for the report, do you mind filing a separate issue for password fields?

@filiph filiph added the a: annoyance Repeatedly frustrating issues with non-experimental functionality label Sep 11, 2019
@marclester-tang
Copy link

This issue still persists in android 10

@pythoneer
Copy link

@marclester-tang what do you mean? Is there a regression that makes the issue reoccur on Android 10? I can't really tell what "still" means in this context, because the issue was solved thus it can't be "still" there. Or do you want us to know that the problem was never solved on your environment? What version of Flutter do you have? Regardless of your particular case it is the best idea if you file a new issue with your specific problem because it looks like the issue was solved for the majority of the people involved.

@mklim
Copy link
Contributor

mklim commented Sep 16, 2019

@marclester-tang @pythoneer sounds like issue #38375.

@smurfxx
Copy link

smurfxx commented Nov 20, 2019

I can confirm that the keyboard issue is still present on Android 10, I tested on a Pixel 3a and the keyboard never appears when focusing an input text field of the web pages.

@mklim
Copy link
Contributor

mklim commented Nov 20, 2019

@smurfxx thanks for the report. Could you please file a new issue for this with flutter doctor if you're seeing this on a recent version of Flutter? So far it sounds like #38375. That has been fixed upstream but currently the fix still hasn't rolled into stable.

@ChrisFetterly
Copy link

Same issues today with keyboard. Can focus the input field within the WebViews but the keyboard does not populate the field. We tried on both a nexus and a Huawei mate 9 pro.

@mklim
Copy link
Contributor

mklim commented Feb 3, 2020

@ChrisFetterly thanks for the report. Could you file a new issue for the problem you're seeing with the output of flutter doctor and a small reproducible sample case?

@hnvn
Copy link

hnvn commented May 6, 2020

Hi guys, I am facing a problem with keyboard in Android that it overlaps input fields when it shows up. Is there anyone know this issue?

@jtibbles
Copy link

On Android it doesn't seem to work if you click inside the textfield, it only works if you click on the top border of the textfield. Then the keyboard pops up.
And if you click anywhere else the keyboard remains on-screen.

@veselinnguyen
Copy link

Hi guys,
The issue still occurs and it has been here for ages. Noone has found already a solution?

I am opening a WEBPAGE in a FLUTTER WEBVIEW. The Keyboard works only for ANDROID.

Screenshot 2020-06-23 at 11 13 10 PM

@crypto-maria
Copy link

Hi guys,
The issue still occurs and it has been here for ages. Noone has found already a solution?

I am opening a WEBPAGE in a FLUTTER WEBVIEW. The Keyboard works only for ANDROID.

Screenshot 2020-06-23 at 11 13 10 PM

Have you got any solution for this?

@matuella
Copy link

matuella commented Oct 7, 2020

Hi guys,
The issue still occurs and it has been here for ages. Noone has found already a solution?

I am opening a WEBPAGE in a FLUTTER WEBVIEW. The Keyboard works only for ANDROID.

Screenshot 2020-06-23 at 11 13 10 PM

are you sure you haven't disabled the simulator visual keyboard (CMD + K / SHIFT + CMD + K)?

@crypto-maria
Copy link

crypto-maria commented Oct 7, 2020 via email

@github-actions
Copy link

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 flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2021
@flutter-triage-bot flutter-triage-bot bot added the package flutter/packages repository. See also p: labels. label Jul 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: annoyance Repeatedly frustrating issues with non-experimental functionality a: platform-views Embedding Android/iOS views in Flutter apps c: new feature Nothing broken; request for a new capability customer: crowd Affects or could affect many people, though not necessarily a specific customer. customer: google Various Google teams engine flutter/engine repository. See also e: labels. framework flutter/packages/flutter repository. See also f: labels. p: webview The WebView plugin package flutter/packages repository. See also p: labels. platform-android Android applications specifically
Projects
None yet
Development

No branches or pull requests