Skip to content

[webview_flutter] Unable to focus on text input in webview  #132143

Closed
flutter/packages
#4667

Description

@fondoger

Is there an existing issue for this?

What package does this bug report belong to?

webview_flutter

What target platforms are you seeing this bug on?

Android

Have you already upgraded your packages?

Yes

Dependency versions

pubspec.lock
No provided. Please see the screenshot.

Steps to reproduce

Steps to reproduce issue:

  • Upgrade webview_flutter_android to 3.9.2

Important: I can only reproduce the issue on Android device in Release mode. I tested debug mode, the issue does not show. I think the showing of keyboard somehow caused the flutter app to re-render the webview.

Steps I used to fix the bug:

  • Downgrade webview_flutter_android to 3.8.2

I believe the bug was introduced two weeks ago in this PR: flutter/packages#4533
image

Please revert that PR until some one come up with a better solution.

Expected results

Expected Behavior: When I tap to focus on a <input> element in webview, the soft keyboard shows and I can type normally.

expected.mp4

Actual results

Wrong behavior: When I tap to focus on a <input> element in webview, the page flashes with white screen, and automatically loose focus. The soft keyboard cannot open and I cannot type.

notexpected.mp4

Code sample

Code sample
No provided. Please see the videos I uploaded.

Screenshots or Videos

Screenshots / Video demonstration

Expected Behavior: When I tap to focus on a <input> element in webview, the soft keyboard shows and I can type normally.

expected.mp4

Wrong behavior: When I tap to focus on a <input> element in webview, the page flashes with white screen, and automatically loose focus. The soft keyboard cannot open and I cannot type.

notexpected.mp4

Logs

Logs
No related logs.

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.10.6, on macOS 13.4.1 22F770820d darwin-x64, locale en-CN)
    • Flutter version 3.10.6 on channel stable at /Users/fondoger/development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f468f3366c (4 weeks ago), 2023-07-12 15:19:05 -0700
    • Engine revision cdbeda788a
    • Dart version 3.0.6
    • DevTools version 2.23.1

[!] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at /Users/fondoger/Library/Android/sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E300c
    • CocoaPods version 1.12.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)

[✓] VS Code (version 1.80.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.70.0

[✓] Connected device (3 available)            
    • V2055A (mobile) • 192.168.0.100:42651 • android-arm64  • Android 12 (API 31)
    • macOS (desktop) • macos               • darwin-x64     • macOS 13.4.1 22F770820d darwin-x64
    • Chrome (web)    • chrome              • web-javascript • Google Chrome 115.0.5790.170

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

Activity

  1. darshankawar commented on Aug 9, 2023

    @darshankawar
    Member

    Thanks for the report @fondoger
    I tried the plugin example and ran in release mode but was able to input and type in properly and it also showed up the keyboard properly as below:

    Screenshot 2023-08-09 at 1 27 04 PM

    I used latest plugin versions. If above doesn't represent your case, can you provide us a minimal code sample so that we can make the issue actionable ?

  2. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Aug 9, 2023
  3. JDongKhan commented on Aug 9, 2023

    @JDongKhan

    Help, same issue was found in my app with few android devices.

  4. JDongKhan commented on Aug 9, 2023

    @JDongKhan

    webview_flutter_android: 3.8.2 is work for me.

    It seems to have occurred during the first installation.

  5. JDongKhan commented on Aug 9, 2023

    @JDongKhan
  6. darshankawar commented on Aug 9, 2023

    @darshankawar
    Member

    I tried by using <input type="text"> in plugin example, ran in release mode in which the keyboard opened properly:

    Screenshot 2023-08-09 at 6 14 39 PM
  7. added
    r: fixedIssue is closed as already fixed in a newer version
    and removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    in triagePresently being triaged by the triage team
    on Aug 10, 2023
  8. github-actions commented on Aug 24, 2023

    @github-actions

    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.

  9. locked as resolved and limited conversation to collaborators on Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    r: fixedIssue is closed as already fixed in a newer version

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions