Skip to content

Samsung Pass unfocuses TextField #144224

Open
@sergioprot

Description

@sergioprot

Steps to reproduce

  1. Write a Flutter app that uses an AutofillGroup with one ore more TextFields.
  2. Make sure Samsung Pass is set up on your device. If it is not installed, here is the link: https://apps.samsung.com/appquery/appDetail.as?appId=com.samsung.android.samsungpass&cId=000005295090
    Follow these instructions to set up the Samsung Pass (see the How to set up Samsung Pass section): https://www.samsung.com/latin_en/support/mobile-devices/how-to-set-up-and-use-samsung-pass-on-your-galaxy-phone/
  3. Run the app on a Samsung device with Samsung Pass on
  4. Fill the TextFields

Expected results

Samsung Pass popup is shown, but does not unfocus the TextField

Actual results

After the very first letter in the TextField is entered, Samsung Pass popup is shown, the TextField is unfocused, so user should tap the TextField again to continue filling the form.

Code sample

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

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

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final _formKey = GlobalKey<FormState>();
  final _usernameController = TextEditingController();
  final _passwordController = TextEditingController();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Samsung Pass'),
      ),
      body: Form(
        key: _formKey,
        child: AutofillGroup(
          child: Column(
            children: [
              TextField(
                controller: _usernameController,
                autofillHints: const [AutofillHints.email],
                keyboardType: TextInputType.emailAddress,
                decoration: const InputDecoration(
                  labelText: 'Email',
                ),
              ),
              TextField(
                controller: _passwordController,
                autofillHints: const [AutofillHints.password],
                obscureText: true,
                decoration: const InputDecoration(
                  labelText: 'Password',
                ),
              ),
              ElevatedButton(
                onPressed: () {
                  TextInput.finishAutofillContext();
                },
                child: const Text('Test Send'),
              )
            ],
          ),
        ),
      ),
    );
  }
}

Screenshots or Video

Samsung Galaxy S24 Plus, Android 14 (Samsung Pass)
autofill-samsung.mp4
Google Pixel 7 Pro, Android 14 (Google Password Manager)
autofill-google.mp4

Logs

Logs
N/A

Flutter Doctor output

Doctor output
sergey@Sergeys-MacBook-Pro mpc % flutter doctor                   
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.19.1, on macOS 14.3.1 23D60 darwin-arm64, locale en-LV)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] Connected device (2 available)
    ! Error: Browsing on the local area network for Sergey Protchenko’s iPad. Ensure the device is unlocked and attached with a cable or associated
      with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: text inputEntering text in a text field or keyboard related problemse: device-specificOnly manifests on certain devicese: samsungIssues only reproducible on Samsung devicesf: focusFocus traversal, gaining or losing focusf: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.platform-androidAndroid applications specificallyteam-text-inputOwned by Text Input team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions