Skip to content

Autofill on web is only activated after clicking twice on the TextField #66356

@jlubeck

Description

@jlubeck

When you create a TextField with autofillHints, at least on web the hint is only activate after you click twice on the TextField. If you have multiple TextFields you can keep on clicking through them all without ever seeing the hints unless you click again once the caret is active in the TextField.

Seeing other sites, this is not the expected behavior, which makes sense... I would expect for the hint to show up as soon as the TextField has focus.

Here is a reproducible code for DartPad:

import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            TextFormField(
              autofillHints: [AutofillHints.email],
            decoration: InputDecoration(
            hintText: 'Email',
           
          ),
              
            ),
            TextFormField(
              autofillHints: [AutofillHints.telephoneNumber],
            decoration: InputDecoration(
            hintText: 'Phone',
           
          ),
              
            ),
          ],
        ),
      ),
    ),
    );
  }
}

At the time of posting, DartPad is Based on Flutter 1.22.0-12.1.pre Dart SDK 2.9.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: text inputEntering text in a text field or keyboard related problemsf: material designflutter/packages/flutter/material repository.found in release: 3.19Found to occur in 3.19found in release: 3.21Found to occur in 3.21frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyteam-webOwned by Web platform teamtriaged-webTriaged by Web platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions