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

AutofillHints.oneTimeCode not works on flutter web on iOS #104693

Open
amir14a opened this issue May 26, 2022 · 10 comments
Open

AutofillHints.oneTimeCode not works on flutter web on iOS #104693

amir14a opened this issue May 26, 2022 · 10 comments
Labels
a: text input Entering text in a text field or keyboard related problems browser: safari-ios only manifests in Safari on iOS c: new feature Nothing broken; request for a new capability f: material design flutter/packages/flutter/material repository. found in release: 3.0 Found to occur in 3.0 found in release: 3.1 Found to occur in 3.1 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on P3 Issues that are less important to the Flutter project platform-web Web applications specifically team-web Owned by Web platform team triaged-web Triaged by Web platform team

Comments

@amir14a
Copy link

amir14a commented May 26, 2022

Hi, I want to suggest sms one time code to the user on iOS, flutter web, safari browser.
I tried many options but none of them solved the problem.
my code:

import 'package:flutter/material.dart';

void main() {
  runApp(const TestOneTimeCodeApp());
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Padding(
          padding: const EdgeInsets.all(16.0),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: const [
              TextField(
                autofillHints: [AutofillHints.oneTimeCode],
                decoration: InputDecoration(hintText: "text input with autofill hint=oneTimeCode"),
              ),//not works
              TextField(
                keyboardType: TextInputType.number,
                autofillHints: [AutofillHints.oneTimeCode],
                decoration: InputDecoration(hintText: "text input with autofill hint=oneTimeCode and keyboardType=number"),
              ),//not works
              TextField(
                keyboardType: TextInputType.phone,
                autofillHints: [AutofillHints.oneTimeCode],
                decoration: InputDecoration(hintText: "text input with autofill hint=oneTimeCode and keyboardType=phone"),
              ),//not works
            ],
          ),
        ),
      ),
    );
  }
}

[√] Flutter (Channel stable, 3.0.1, on Microsoft Windows [Version 10.0.19042.1110], locale en-US)

It works on iOS native app, but not works on flutter web on iOS
the result:
image

@huycozy huycozy added the in triage Presently being triaged by the triage team label May 26, 2022
@huycozy
Copy link
Member

huycozy commented May 26, 2022

Hi @amir14a,
I'm not sure if this feature is available in any app yet. If yes, can you please cite it here?

However, I've verified this on iOS app and Web app.
It worked on iOS but the Web(Safari) did not.

Thanks!

@huycozy huycozy added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 26, 2022
@amir14a
Copy link
Author

amir14a commented May 26, 2022

Hi @huycozy
I don't know any flutter application that supports this feature on web, but there are many web applications that are not developed with flutter and supports this feature.

For example, I write this simple html code and it works:

<form action="">
        <input name="one-time-code" id="one-time-code" type="text" autocomplete="one-time-code" autocorrect="off">
        //this not works
        <br>
        <input name="one-time-code" id="one-time-code" type="tel" autocomplete="one-time-code" autocorrect="off">
        //this works
</form>

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 26, 2022
@huycozy
Copy link
Member

huycozy commented May 27, 2022

Thanks for responding. This issue is reproducible on the latest stable and master channels.

Demo
Web browser (Safari) iOS
flutter doctor -v
[✓] Flutter (Channel stable, 3.0.1, on macOS 12.2.1 21D62 darwin-x64, locale en-VN)
    • Flutter version 3.0.1 at /Users/huynq/Documents/GitHub/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision fb57da5f94 (8 hours ago), 2022-05-19 15:50:29 -0700
    • Engine revision caaafc5604
    • Dart version 2.17.1
    • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/huynq/Library/Android/sdk
    • Platform android-32, build-tools 31.0.0
    • ANDROID_HOME = /Users/huynq/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.3

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

[✓] Android Studio (version 2021.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.12+0-b1504.28-7817840)

[✓] Android Studio (version 4.1)
    • Android Studio at /Users/huynq/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.7042882/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)

[✓] Android Studio
    • Android Studio at /Users/huynq/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-1/203.7185775/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
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6842174)

[✓] IntelliJ IDEA Community Edition (version 2020.3.3)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • 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

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

[✓] Connected device (3 available)
    • iPhone 13 (mobile) • 2526BC1A-435D-4B08-B99C-44B928F2517B • ios            • com.apple.CoreSimulator.SimRuntime.iOS-15-4 (simulator)
    • macOS (desktop)    • macos                                • darwin-x64     • macOS 12.2.1 21D62 darwin-x64
    • Chrome (web)       • chrome                               • web-javascript • Google Chrome 101.0.4951.64

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!
[✓] Flutter (Channel master, 3.1.0-0.0.pre.960, on macOS 12.2.1 21D62 darwin-x64, locale en-VN)
    • Flutter version 3.1.0-0.0.pre.960 at /Users/huynq/Documents/GitHub/flutter_master
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5f742c96d3 (75 minutes ago), 2022-05-26 22:35:09 -0400
    • Engine revision 8b221027f3
    • Dart version 2.18.0 (build 2.18.0-149.0.dev)
    • DevTools version 2.13.1

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/huynq/Library/Android/sdk
    • Platform android-32, build-tools 31.0.0
    • ANDROID_HOME = /Users/huynq/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.3

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

[✓] Android Studio (version 2021.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.12+0-b1504.28-7817840)

[✓] Android Studio (version 4.1)
    • Android Studio at /Users/huynq/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.7042882/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)

[!] Android Studio
    • Android Studio at /Users/huynq/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-1/203.7185775/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.

[✓] IntelliJ IDEA Community Edition (version 2020.3.3)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • 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

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

[✓] Connected device (3 available)
    • iPad Pro (9.7-inch) (mobile) • 18AFB65F-7639-4B97-86BD-2A60F1B99BBC • ios            • com.apple.CoreSimulator.SimRuntime.iOS-15-4
      (simulator)
    • macOS (desktop)              • macos                                • darwin-x64     • macOS 12.2.1 21D62 darwin-x64
    • Chrome (web)                 • chrome                               • web-javascript • Google Chrome 101.0.4951.64

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.

@huycozy huycozy added a: text input Entering text in a text field or keyboard related problems platform-ios iOS applications specifically framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. platform-web Web applications specifically has reproducible steps The issue has been confirmed reproducible and is ready to work on browser: safari-ios only manifests in Safari on iOS found in release: 3.0 Found to occur in 3.0 found in release: 3.1 Found to occur in 3.1 and removed in triage Presently being triaged by the triage team labels May 27, 2022
@cyanglaz cyanglaz removed the platform-ios iOS applications specifically label May 27, 2022
@yjbanov yjbanov added c: new feature Nothing broken; request for a new capability P3 Issues that are less important to the Flutter project labels May 28, 2022
@up-dog
Copy link

up-dog commented Jun 12, 2022

Hi, I am running into the same issue. During testing I noticed that iOS Chrome supports autofilling. The issue is specific to safari. Hope this gets resolved quickly!

@Peng-Qian
Copy link

any updates?

@NikFanton
Copy link

Any updates so far?

@flutter-triage-bot flutter-triage-bot bot added multiteam-retriage-candidate team-web Owned by Web platform team triaged-web Triaged by Web platform team labels Jul 8, 2023
@yuvansundrani
Copy link

Would really appreciate if someone solved this, still not working on Safari...

@nikolaychernov
Copy link

Works for me in Safari in Flutter 3.13.0

@sadjadtalakoob74

This comment was marked as duplicate.

@marcosicp
Copy link

any news on this?

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 browser: safari-ios only manifests in Safari on iOS c: new feature Nothing broken; request for a new capability f: material design flutter/packages/flutter/material repository. found in release: 3.0 Found to occur in 3.0 found in release: 3.1 Found to occur in 3.1 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on P3 Issues that are less important to the Flutter project platform-web Web applications specifically team-web Owned by Web platform team triaged-web Triaged by Web platform team
Projects
None yet
Development

No branches or pull requests