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

[web][regression] text autofill doesn't work #86497

Closed
arualana opened this issue Jul 15, 2021 · 29 comments
Closed

[web][regression] text autofill doesn't work #86497

arualana opened this issue Jul 15, 2021 · 29 comments
Labels
a: text input Entering text in a text field or keyboard related problems c: regression It was better in the past than it is now customer: crowd Affects or could affect many people, though not necessarily a specific customer. engine flutter/engine repository. See also e: labels. found in release: 2.3 Found to occur in 2.3 found in release: 2.4 Found to occur in 2.4 has reproducible steps The issue has been confirmed reproducible and is ready to work on P1 High-priority issues at the top of the work list platform-web Web applications specifically

Comments

@arualana
Copy link

arualana commented Jul 15, 2021

We have a login form with just email and password

This used to work I think until 2.3.0-0.1.pre, and broke at 2.3.0-16.0.pre

I am not 100% sure which one was the upgrade that stopped it from working (I am sure it was one upgrade, though), but it was recently, and further upgrades have not solved the problem

The data is actually stored (i.e. I get the prompt to ask if I want to save/update the data in the browser and I can see it in settings -> autofill -> passwords) but there is no autofill happening on the password, the username/email only gets auto-filled

The code simplified

ListView(
      children: <Widget>[
        AutofillGroup(
          child: Column(
            children: <Widget>[
              TextFormField(
                controller: _emailTextController,
                autofillHints: const <String>[
                  AutofillHints.username,
                  AutofillHints.email
                ],
              ),
              TextFormField(
                controller: _passwordTextController,
                autofillHints: const <String>[AutofillHints.password],
              ),
              MyButton(                
                label: 'Sign In',
                onPressed: _login,
              )
            ],
          ),
        ),
      ],
    );
  }
Running flutter doctor...
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel dev, 2.4.0-4.0.pre, on Linux Mint 20.1 5.4.0-58-generic, locale en_US.UTF-8)

[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 4.1)
[✓] Android Studio
[✓] IntelliJ IDEA Ultimate Edition (version 2021.1)
[✓] VS Code (version 1.56.2)
[✓] Connected device (2 available)
@arualana arualana reopened this Jul 15, 2021
@arualana arualana reopened this Jul 15, 2021
@TahaTesser TahaTesser added the in triage Presently being triaged by the triage team label Jul 16, 2021
@TahaTesser
Copy link
Member

TahaTesser commented Jul 16, 2021

Hi @arualana
Thanks for the code sample, I've just tried your code on multiple platforms (Linux, Windows, macOS), on multiple Flutter channels. It seems to work on the stable channel only. in my testing field are not being filled on other channels

Used the following minimal code sample

minimal code sample
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Material App',
      theme: ThemeData.dark(),
      home: Home(),
    );
  }
}

class Home extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Material App Bar'),
      ),
      body: Center(
        child: ListView(
          children: <Widget>[
            AutofillGroup(
              child: Column(
                children: <Widget>[
                  TextFormField(
                    autofillHints: const <String>[
                      AutofillHints.username,
                      AutofillHints.email
                    ],
                  ),
                  TextFormField(
                    autofillHints: const <String>[AutofillHints.password],
                  ),
                  ElevatedButton(
                    child: Text('Sign In'),
                    onPressed: () {
                      TextInput.finishAutofillContext();
                    },
                  )
                ],
              ),
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        child: Icon(Icons.add),
        onPressed: () {},
      ),
    );
  }
}

Steps to reproduce

  1. Run the code with flutter run -d web-server
  2. Open localhost address in the regular Chrome window
  3. Enter credentials, save it using chrome (from the button in address on right side)
  4. Clear the text, try to autofill

Results:

stable, 2.2.3

Autofill works, credentials are entered

Screen.Recording.2021-07-16.at.3.36.29.PM.mov

latest beta, 2.3.0-24.1.pre to Channel master, 2.4.0-5.0.pre.76

Autofill doesn't work, nothing is filled

Screen.Recording.2021-07-16.at.3.33.45.PM.mov
chrome canvaskit html
debug
stable beta dev master

Check flutter doctor -v outputs for each channel below

flutter doctor -v
[✓] Flutter (Channel stable, 2.2.3, on macOS 12.0 21A5284e darwin-x64, locale en-GB)
    • Flutter version 2.2.3 at /Users/tahatesser/Code/flutter_stable
    • Framework revision f4abaa0735 (2 weeks ago), 2021-07-01 12:46:11 -0700
    • Engine revision 241c87ad80
    • Dart version 2.13.4

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/tahatesser/Code/SDK
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = /Users/tahatesser/Code/SDK
    • Java binary at: /Users/tahatesser/Code/openjdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_292-b10)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.5.1, Build version 12E507
    • CocoaPods version 1.10.1

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

[!] Android Studio
    • Android Studio at /Applications/Android Studio Preview.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
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

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

[✓] Connected device (3 available)
    • iPhone 12 Pro (mobile) • 77C62AB9-8B71-43CF-BCAB-85B0A5B52F85 • ios            •
      com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
    • macOS (desktop)        • macos                                • darwin-x64     • macOS
      12.0 21A5284e darwin-x64
    • Chrome (web)           • chrome                               • web-javascript • Google
      Chrome 91.0.4472.164

! Doctor found issues in 1 category.
[✓] Flutter (Channel beta, 2.3.0-24.1.pre, on macOS 12.0 21A5284e darwin-x64,
    locale en-GB)
    • Flutter version 2.3.0-24.1.pre at /Users/tahatesser/Code/flutter_beta
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 615957513e (3 weeks ago), 2021-06-25 09:24:44 -0700
    • Engine revision 9d517f475b
    • Dart version 2.14.0 (build 2.14.0-188.5.beta)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/tahatesser/Code/SDK
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = /Users/tahatesser/Code/SDK
    • Java binary at: /Users/tahatesser/Code/openjdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (AdoptOpenJDK)(build
      1.8.0_292-b10)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.5.1, Build version 12E507
    • CocoaPods version 1.10.1

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

[!] Android Studio
    • Android Studio at /Applications/Android Studio Preview.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
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

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

[✓] Connected device (3 available)
    • iPhone 12 Pro (mobile) • 77C62AB9-8B71-43CF-BCAB-85B0A5B52F85 • ios
      • com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
    • macOS (desktop)        • macos                                • darwin-x64
      • macOS 12.0 21A5284e darwin-x64
    • Chrome (web)           • chrome                               •
      web-javascript • Google Chrome 91.0.4472.164

! Doctor found issues in 1 category.
[✓] Flutter (Channel dev, 2.4.0-4.0.pre, on macOS 12.0 21A5284e darwin-x64,
    locale en-GB)
    • Flutter version 2.4.0-4.0.pre at /Users/tahatesser/Code/flutter_dev
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision cc00e7e6bc (5 days ago), 2021-07-11 18:21:02 -0400
    • Engine revision ed25e8f01e
    • Dart version 2.14.0 (build 2.14.0-301.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/tahatesser/Code/SDK
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = /Users/tahatesser/Code/SDK
    • Java binary at: /Users/tahatesser/Code/openjdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (AdoptOpenJDK)(build
      1.8.0_292-b10)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.5.1, Build version 12E507
    • CocoaPods version 1.10.1

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

[!] Android Studio
    • Android Studio at /Applications/Android Studio Preview.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
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

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

[✓] Connected device (3 available)
    • iPhone 12 Pro (mobile) • 77C62AB9-8B71-43CF-BCAB-85B0A5B52F85 • ios
      • com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
    • macOS (desktop)        • macos                                • darwin-x64
      • macOS 12.0 21A5284e darwin-x64
    • Chrome (web)           • chrome                               •
      web-javascript • Google Chrome 91.0.4472.164

! Doctor found issues in 1 category.
[✓] Flutter (Channel master, 2.4.0-5.0.pre.76, on macOS 12.0 21A5284e
    darwin-x64, locale en-GB)
    • Flutter version 2.4.0-5.0.pre.76 at /Users/tahatesser/Code/flutter_master
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 8cf1de3e68 (8 hours ago), 2021-07-16 01:11:02 -0400
    • Engine revision c2ffafea35
    • Dart version 2.14.0 (build 2.14.0-321.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/tahatesser/Code/SDK
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = /Users/tahatesser/Code/SDK
    • Java binary at: /Users/tahatesser/Code/openjdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (AdoptOpenJDK)(build
      1.8.0_292-b10)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.5.1, Build version 12E507
    • CocoaPods version 1.10.1

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

[!] Android Studio
    • Android Studio at /Applications/Android Studio Preview.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
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

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

[✓] Connected device (3 available)
    • iPhone 12 Pro (mobile) • 77C62AB9-8B71-43CF-BCAB-85B0A5B52F85 • ios
      • com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
    • macOS (desktop)        • macos                                • darwin-x64
      • macOS 12.0 21A5284e darwin-x64
    • Chrome (web)           • chrome                               •
      web-javascript • Google Chrome 91.0.4472.164

! Doctor found issues in 1 category.

✅ : No Issue ❌: Issue reproduced

@TahaTesser TahaTesser added a: text input Entering text in a text field or keyboard related problems engine flutter/engine repository. See also e: labels. found in release: 2.3 Found to occur in 2.3 found in release: 2.4 Found to occur in 2.4 has reproducible steps The issue has been confirmed reproducible and is ready to work on platform-web Web applications specifically c: regression It was better in the past than it is now and removed in triage Presently being triaged by the triage team labels Jul 16, 2021
@TahaTesser TahaTesser changed the title [web] autofill stopped wroking on version upgrade [web] autofill is broken since 2.3.0-16.0.pre Jul 16, 2021
@TahaTesser TahaTesser changed the title [web] autofill is broken since 2.3.0-16.0.pre [web] text autofill doesn't work Jul 16, 2021
@TahaTesser TahaTesser changed the title [web] text autofill doesn't work [web][regression] text autofill doesn't work Jul 16, 2021
@mdebbar mdebbar added the P1 High-priority issues at the top of the work list label Jul 22, 2021
@arualana
Copy link
Author

Hi @TahaTesser is there any update on this? has it been moved to low priority?

@Bes79
Copy link

Bes79 commented Sep 17, 2021

Same issue

@Bes79
Copy link

Bes79 commented Sep 18, 2021

i swith to stable. but not work too

C:\Users\bulic\AndroidStudioProjects\crmdb>flutter --version
Flutter 2.5.1 • channel stable • https://github.com/flutter/flutter.git
Framework • revision ffb2ece (12 hours ago) • 2021-09-17 15:26:33 -0400
Engine • revision b3af521a05
Tools • Dart 2.14.2

@Ashirg-ch
Copy link

Same issue. This functionality ceased working roughly about when we upgraded to Flutter 2.5.0. No error messages.

flutter --version

Flutter 2.5.1 • channel stable • https://github.com/flutter/flutter.git
Framework • revision ffb2ece (3 days ago) • 2021-09-17 15:26:33 -0400
Engine • revision b3af521a05
Tools • Dart 2.14.2

@Bes79
Copy link

Bes79 commented Sep 22, 2021

I think its because of added shadowRoute node in Dom.

@Bes79
Copy link

Bes79 commented Sep 22, 2021

with shadow-root - not working
badApp
without shadow-root - working - good
goodApp

@Bes79
Copy link

Bes79 commented Oct 31, 2021

Is any information?

@Bes79
Copy link

Bes79 commented Nov 19, 2021

Doesn't anyone use autofill that developers can ignore this error so long?

@tjholic
Copy link

tjholic commented Nov 27, 2021

flutter web "autofill" function is not performed in version higher than 2.3.0-0.1.pre.

@dnkoulouris
Copy link

Same issue here that creates issues with our applications. Are there any updates/progress?

@ob-juliandixon
Copy link

Having the same issue on Flutter 2.5.0,

@Frogperson
Copy link

#94043 seems to fix it on Firefox, but not on Chrome. Haven't tested in Safari or any other browser

@ob-juliandixon
Copy link

#94043 seems to fix it on Firefox, but not on Chrome. Haven't tested in Safari or any other browser

Seems like this PR may be implementing a more thorough fix than the workaround proposed in the above issue #95210

@Frogperson
Copy link

#94043 seems to fix it on Firefox, but not on Chrome. Haven't tested in Safari or any other browser

Seems like this PR may be implementing a more thorough fix than the workaround proposed in the above issue #95210

Oops, that's what I meant to link, my bad! #95210 does indeed fix it on Android and Firefox from my tests, but does not change anything on Chrome (again, haven't tested Safari or anything else).
Also, taking a peak at the commit in that pull request, it's actually the exact same change mentioned by morvagergely in issue 94043, so sadly doesn't seem to be any more thorough.

@MasterEthan
Copy link

MasterEthan commented Jan 16, 2022

Does anyone have any further updates on this issue? Even with latest autofill fixes now in master they don't fix the autofill of two fields, user/email and password, in Chrome.

#94043 seems to fix it on Firefox, but not on Chrome. Haven't tested in Safari or any other browser

Seems like this PR may be implementing a more thorough fix than the workaround proposed in the above issue #95210

Oops, that's what I meant to link, my bad! #95210 does indeed fix it on Android and Firefox from my tests, but does not change anything on Chrome (again, haven't tested Safari or anything else). Also, taking a peak at the commit in that pull request, it's actually the exact same change mentioned by morvagergely in issue 94043, so sadly doesn't seem to be any more thorough.

I had the same results testing #95210. Chrome does suggest autofill for email/username but it does not autofill from the password manager like it use to (I tested in 2.2.3 stable).

@Bes79
Copy link

Bes79 commented Jan 28, 2022

Hi, already flutter upgraded on 2.8.1 version, but autofill stil not worked in web. does no one use this?

@ugurberkecan
Copy link

ugurberkecan commented Feb 4, 2022

I also have same issue on chrome.

@navaronbracke
Copy link
Contributor

This still happens on the latest stable 2.10.2

@Bes79
Copy link

Bes79 commented Apr 1, 2022

Still on flutter.2.10.4. Are only 12 people concerned about this?

@Sominemo
Copy link

Surprised this has zero progress yet. Did anyone come with some workarounds, except implementing own autofill with local storage?

@Sominemo
Copy link

I think it's because of added shadowRoute node in Dom.

I can reproduce the fact autofill starts working when you bring the inputs out of the Shadow DOM, but there's a catch.
Originally I thought this might be related to this Chromium bug: Issue 649162: Related inputs separated by shadow root do not autofill.

After launching Chrome Canary with the --enable-blink-features=AutofillShadowDOM flag, affected websites mentioned in the issue started working, but not Flutter, so the reason might be deeper.

@Rexios80
Copy link
Contributor

Rexios80 commented Oct 17, 2022

This is still an issue on Flutter 3.3.4. At least finally iOS and Android autofill seems to work (not sure what version fixed it, but it was broken for a while). Here is a hosted sample so you can see it not working: https://rexios80.github.io/flutter_autofill_test/stable

And the repo that built that: https://github.com/Rexios80/flutter_autofill_test

@darshankawar darshankawar added the customer: crowd Affects or could affect many people, though not necessarily a specific customer. label Nov 4, 2022
@IvoCurado
Copy link

I find myself with the same problem developing for the web and using Flutter stable version 3.3.9.
@arualana @Rexios80 Have you found any solution for this problem?

@Rexios80
Copy link
Contributor

Rexios80 commented Jan 9, 2023

If that sample app doesn't work then no

@Rexios80
Copy link
Contributor

I updated that repo to auto deploy builds for flutter channel stable, beta, and master every week so I don't have to maintain it anymore.

https://rexios80.github.io/flutter_autofill_test/stable
https://rexios80.github.io/flutter_autofill_test/beta
https://rexios80.github.io/flutter_autofill_test/master

@IvoCurado
Copy link

I updated that repo to auto deploy builds for flutter channel stable, beta, and master every week so I don't have to maintain it anymore.

https://rexios80.github.io/flutter_autofill_test/stable https://rexios80.github.io/flutter_autofill_test/beta https://rexios80.github.io/flutter_autofill_test/master

Oh ok, thanks for the feedback.

@yjbanov
Copy link
Contributor

yjbanov commented Mar 21, 2023

I believe this can be deduplicated with #87735. Please feel free to reopen if I'm wrong.

@yjbanov yjbanov closed this as completed Mar 21, 2023
@github-actions
Copy link

github-actions bot commented Apr 4, 2023

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 Apr 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: text input Entering text in a text field or keyboard related problems c: regression It was better in the past than it is now customer: crowd Affects or could affect many people, though not necessarily a specific customer. engine flutter/engine repository. See also e: labels. found in release: 2.3 Found to occur in 2.3 found in release: 2.4 Found to occur in 2.4 has reproducible steps The issue has been confirmed reproducible and is ready to work on P1 High-priority issues at the top of the work list platform-web Web applications specifically
Projects
None yet
Development

No branches or pull requests