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

Autofill Hints iOS: AutofillHints.newPassword only recommends once on navigating #84452

Open
lukepighetti opened this issue Jun 11, 2021 · 8 comments
Labels
a: text input Entering text in a text field or keyboard related problems customer: flex f: material design flutter/packages/flutter/material repository. found in release: 2.2 Found to occur in 2.2 found in release: 2.3 Found to occur in 2.3 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on platform-ios iOS applications specifically team-design Owned by Design Languages team triaged-design Triaged by Design Languages team

Comments

@lukepighetti
Copy link

Steps to Reproduce

  1. Run on iOS device
  2. Tap the Push create account screen button
  3. Focus on password field
  4. iOS new password dialog will show and autofill a safe password
  5. Tap on the back button
  6. Repeat Step 2-3
  7. iOS new password dialog will show, but WILL NOT autofill a safe password
RPReplay_Final1623433755.MP4

MCVE

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(SpikeApp());
}

class SpikeApp extends StatelessWidget {
  const SpikeApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      routes: {
        '/': (_) => _HomeScreen(),
        'create-account': (_) => _CreateAccountScreen(),
      },
    );
  }
}

class _HomeScreen extends StatelessWidget {
  const _HomeScreen({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            ElevatedButton(
              child: Text('Push create account screen'),
              onPressed: () {
                Navigator.of(context).pushNamed('create-account');
              },
            ),
          ],
        ),
      ),
    );
  }
}

class _CreateAccountScreen extends StatefulWidget {
  const _CreateAccountScreen({Key? key}) : super(key: key);

  @override
  __CreateAccountScreenState createState() => __CreateAccountScreenState();
}

class __CreateAccountScreenState extends State<_CreateAccountScreen> {
  final emailController = TextEditingController();
  final passwordController = TextEditingController();

  @override
  Widget build(BuildContext context) {
    final spacer = SizedBox(height: 25);

    return Scaffold(
      appBar: AppBar(
        title: Text('Create account'),
      ),
      body: SafeArea(
        child: Padding(
          padding: const EdgeInsets.all(25),
          child: AutofillGroup(
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.stretch,
              children: [
                Text('Create account'),
                spacer,
                TextField(
                  controller: emailController,
                  autofillHints: [
                    AutofillHints.email,
                  ],
                  textInputAction: TextInputAction.next,
                  decoration: InputDecoration(
                    hintText: 'Your email',
                  ),
                ),
                spacer,
                TextField(
                  controller: passwordController,
                  autofillHints: [
                    AutofillHints.newPassword,
                  ],
                  decoration: InputDecoration(
                    hintText: 'Your password',
                  ),
                ),
                spacer,
                ElevatedButton(
                  child: Text('Save account info'),
                  onPressed: () {
                    TextInput.finishAutofillContext();
                  },
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}

flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.2.1, on macOS 11.4 20F71 darwin-x64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] VS Code (version 1.57.0)
[✓] Connected device (3 available)

• No issues found!
@TahaTesser TahaTesser added the in triage Presently being triaged by the triage team label Jun 14, 2021
@TahaTesser
Copy link
Member

Hi @lukepighetti
Thanks for filing the issue
Can you please provide your iOS version? (as I am getting results on the different result iOS version, iOS 12 and 15)

@TahaTesser TahaTesser added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jun 14, 2021
@lukepighetti
Copy link
Author

I was able to reproduce it just now with the steps listed above.

flutter doctor -v
[✓] Flutter (Channel stable, 2.2.2, on macOS 11.4 20F71 darwin-x64, locale en-US)
    • Flutter version 2.2.2 at /Users/lukepighetti/development/flutter
    • Framework revision d79295af24 (3 days ago), 2021-06-11 08:56:01 -0700
    • Engine revision 91c9fc8fe0
    • Dart version 2.13.3

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/lukepighetti/Library/Android/sdk
    • Platform android-30, build-tools 30.0.2
    • ANDROID_HOME = /Users/lukepighetti/Library/Android/sdk
    • ANDROID_SDK_ROOT = /Users/lukepighetti/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

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

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

[✓] Android Studio (version 4.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 1.8.0_242-release-1644-b3-6915495)

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

[✓] Connected device (3 available)
    • Luke's iPhone (mobile) • xxxxx • ios            • iOS 14.6
    • macOS (desktop)        • macos                                    • darwin-x64     • macOS 11.4 20F71 darwin-x64
    • Chrome (web)           • chrome                                   • web-javascript • Google Chrome 91.0.4472.101

• No issues found!

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jun 14, 2021
@TahaTesser
Copy link
Member

Hi @lukepighetti
Thanks for the details,
I can reproduce the issue finally (downgraded to iOS 14.6 last night for your issues)

I can produce the issue on iOS 14.6

If launched TextField screens directly

Preview

If navigated to TextField screen (tapping text field again shows the password, not immediately as it should)

Preview

On master, it is even worse, tapping multiple shows the password

Preview
stable master

Check flutter doctor -v outputs for each channel below

flutter doctor -v
[✓] Flutter (Channel stable, 2.2.2, on macOS 12.0 21A5248p darwin-x64, locale
    en-GB)
    • Flutter version 2.2.2 at /Users/tahatesser/Code/flutter_stable
    • Framework revision d79295af24 (4 days ago), 2021-06-11 08:56:01 -0700
    • Engine revision 91c9fc8fe0
    • Dart version 2.13.3

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Volumes/Extreme/SDK
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = /Volumes/Extreme/SDK
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Volumes/Extreme/Xcode-beta.app/Contents/Developer
    • Xcode 13.0, Build version 13A5154h
    • CocoaPods version 1.10.1

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

[✓] Android Studio (version 4.2)
    • 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.8+10-b944.6916264)

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

[✓] Connected device (3 available)
    • Taha’s iPhone (mobile) • 00008020-001059882212002E • ios            • iOS
      14.6
    • macOS (desktop)        • macos                     • darwin-x64     •
      macOS 12.0 21A5248p darwin-x64
    • Chrome (web)           • chrome                    • web-javascript •
      Google Chrome 91.0.4472.101

• No issues found!

✅ : No Issue ❌: Issue reproduced

@TahaTesser TahaTesser changed the title Autofill Hints iOS: .newPassword only recommends once per app launch Autofill Hints iOS: AutofillHints.newPassword only recommends once on navigating Jun 15, 2021
@TahaTesser TahaTesser added a: text input Entering text in a text field or keyboard related problems f: material design flutter/packages/flutter/material repository. found in release: 2.2 Found to occur in 2.2 found in release: 2.3 Found to occur in 2.3 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on platform-ios iOS applications specifically and removed in triage Presently being triaged by the triage team labels Jun 15, 2021
@djsjr
Copy link

djsjr commented Sep 7, 2021

I am having the same issue as OP. iOS autofill new password once, but never again. Prompt always appears. I am running iOS 14.7.1

@florian-ac
Copy link

hi,

I have the same Issue with iOS 15.4.1 (real device) and Flutter (Channel stable, 2.10.5).
Is there a solution?

@MuhammadEhsanMirzaei
Copy link

MuhammadEhsanMirzaei commented May 25, 2022

I have the same issue
any update?

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.10.5, on macOS 12.3.1 21E258 darwin-x64, locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
    ✗ 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 13.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] VS Code (version 1.67.2)
[✓] VS Code (version 1.63.2)
[✓] Connected device (1 available)

@Ashotjlavyan
Copy link

Ashotjlavyan commented Aug 31, 2022

I have same issue, but when app goes background and back foreground then password is auto filled.
I think this issue is come from https://github.com/flutter/engine

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.3.0, on macOS 12.4 21F79 darwin-x64, locale en-AM)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] VS Code (version 1.70.2)
[✓] Connected device (5 available)
[✓] HTTP Host Availability

@puzakd
Copy link

puzakd commented May 26, 2023

Hey @lukepighetti
Sorry for the off-topic question, but have you configured apple-apple-site-association to make the password suggestion work? For some reason it only works for me on Android, and adding apple-apple-site-association on the server-side file seems like something extra.

@flutter-triage-bot flutter-triage-bot bot added multiteam-retriage-candidate team-ios Owned by iOS platform team triaged-ios Triaged by iOS platform team labels Jul 8, 2023
@stuartmorgan stuartmorgan added team-design Owned by Design Languages team triaged-design Triaged by Design Languages team and removed team-ios Owned by iOS platform team triaged-ios Triaged by iOS platform team labels Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: text input Entering text in a text field or keyboard related problems customer: flex f: material design flutter/packages/flutter/material repository. found in release: 2.2 Found to occur in 2.2 found in release: 2.3 Found to occur in 2.3 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on platform-ios iOS applications specifically team-design Owned by Design Languages team triaged-design Triaged by Design Languages team
Projects
None yet
Development

No branches or pull requests

10 participants