Skip to content

[webview_flutter] Unable to get autocomplete to work in android/iOS #67526

@mathatan

Description

@mathatan

Description

I'm unable to get autocomplete to work in WebView text input fields. The example page works browsers on mobile devices but for some reason when trying to input data in a WebView in a Flutter app autocomplete does not trigger.

Steps to Reproduce

Copy the source code from flutter-plugins-master/packages/webview_flutter/example

Add following constant into main.dart and replace initial page with it

const String kTestHtmlPage = '''
<!DOCTYPE html>
<html>
<head><title>Test auto complete</title></head>
<body>
email:
<input autocomplete="email" id="email" name="email" type="email">
</body>
</html>
''';

by (at the time of writing) replacing initialUrl from main.dart:71 with 'data:text/html;base64,${base64Encode(Utf8Encoder().convert(kTestHtmlPage))}',

Run app either in a physical device or in emulator. Tap on input field.

Expected result:

Keyboard should offer autofill for email address from autofill details stored within device. Same issue happens also with live web-pages, but it's easier to reproduce with inline generated ones.

You can also test your devices autofill capability by copy pasting the base64 url generated for the WebView into your browser.

Or just use this data:

data:text/html;base64,PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8aGVhZD48dGl0bGU+VGVzdCBhdXRvIGNvbXBsZXRlPC90aXRsZT48L2hlYWQ+Cjxib2R5PgplbWFpbDoKPGlucHV0IGF1dG9jb21wbGV0ZT0iZW1haWwiIGlkPSJlbWFpbCIgbmFtZT0iZW1haWwiIHR5cGU9ImVtYWlsIj4KPC9ib2R5Pgo8L2h0bWw+Cg==

Versions:

WebView: webview_flutter 1.0.2

Flutter 1.22.0 • channel beta • https://github.com/flutter/flutter.git
Framework • revision d408d302e2 (8 days ago) • 2020-09-29 11:49:17 -0700
Engine • revision 5babba6c4d
Tools • Dart 2.10.0

Doctor:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, 1.22.0, on Mac OS X 10.15.7 19H2, locale en-FI)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 12.0.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.49.3)
 
[✓] Connected device (5 available)            

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    found in release: 1.22Found to occur in 1.22has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: webviewThe WebView pluginpackageflutter/packages repository. See also p: 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