Skip to content

[Android] After enabling autofillHints, the keyboard automatically hide after entering the first letter #159670

Open

Description

@jiagengArctuition

Steps to reproduce

run this code on a physical Android device (with autofill data populated), then input a letter.

Expected results

Do not auto-hide keyboard

Actual results

the keyboard auto hide

Code sample

import 'package:flutter/material.dart';

void main(List<String> args) {
  runApp(
    MaterialApp(
      home: Scaffold(
        body: Center(
          child: TextField(
            autofillHints: [AutofillHints.name],
          ),
        ),
      ),
    ),
  );
}

Screenshots or Video

My Android phone is OnePlus 9, I'm using WeChat Input Method, and this is my screen recording.

input.mov

Logs

No response

Flutter Doctor output

Doctor output
Doctor summary (to see all details, run
flutter doctor -v):
[✓] Flutter (Channel stable, 3.19.6, on
    macOS 15.1.1 24B91 darwin-arm64,
    locale zh-Hans-CN)
[✓] Android toolchain - develop for
    Android devices (Android SDK version
    34.0.0)
[✓] Xcode - develop for iOS and macOS
    (Xcode 15.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.1)
[✓] VS Code (version 1.95.3)
[✓] Connected device (4 available)
[✓] Network resources

• No issues found!

Activity

  1. added
    in triage
    on Dec 3, 2024
  2. darshankawar commented on Dec 3, 2024

    @darshankawar
    Member

    @jiagengArctuition
    What android device does this occur on ? Can you provide make and model of it ? Does it occur with Gboard or default keyboard ?
    Also, please try to upgrade to latest stable and re-run your scenario to check if the behavior still persist or not.

  3. added
    waiting for response
    on Dec 3, 2024
  4. jiagengArctuition commented on Dec 3, 2024

    @jiagengArctuition
    Author

    @darshankawar I tried Gboard, and indeed it doesn't have this issue. However, both the system's built-in Sogou input method and the installed WeChat input method have this problem.

  5. removed
    waiting for response
    on Dec 3, 2024
  6. jiagengArctuition commented on Dec 3, 2024

    @jiagengArctuition
    Author

    @darshankawar I tried other Android apps on my phone, and they also have autofill, but this strange behavior does not occur when I use Sogou or WeChat input methods. It seems to be a Flutter-specific issue.

  7. darshankawar commented on Dec 4, 2024

    @darshankawar
    Member

    @jiagengArctuition
    Did you try to upgrade to latest stable to check if the issue persist or not ?

  8. added
    waiting for response
    on Dec 4, 2024
  9. jiagengArctuition commented on Dec 4, 2024

    @jiagengArctuition
    Author

    @darshankawar Yes, this issue also exists in the latest version 3.24.5

  10. removed
    waiting for response
    on Dec 4, 2024
  11. darshankawar commented on Dec 4, 2024

    @darshankawar
    Member

    @jiagengArctuition
    What Android device are you using that shows this issue ? I verified on S10+ with which the name is autofilled and I am able to input letter after it properly, but with Chinese input language, I am unable to see the autofill hints showing up. Can you provide us a short video ?

  12. added
    waiting for response
    on Dec 4, 2024
  13. jiagengArctuition commented on Dec 4, 2024

    @jiagengArctuition
    Author

    @darshankawar My Android phone is OnePlus 9, I'm using WeChat Input Method, and this is my screen recording.

    input.mov

    Here are the download links for WeChat Input Method and Sogou Input Method. They are the most popular input methods in China. And they work normally when used in other applications.

    https://z.weixin.qq.com/web/changelog/android
    https://apkdl.sogouimecdn.com/wapdl/android/apk/SogouInput_12.0.1_android_sweb.apk

  14. removed
    waiting for response
    on Dec 4, 2024
  15. darshankawar commented on Dec 5, 2024

    @darshankawar
    Member

    Thanks for the update. I installed the Sogou input keyboard on S10+ device and using it, was able to replicate the reported behavior on latest sdk versions.

    stable : 3.24.5
    master : 3.27.0-1.0.pre.710
    
  16. 19 remaining items

  17. removed
    ⏳
    on Jul 7, 2025
  18. added
    ⏳
    on Nov 11, 2025
  19. flutter-triage-bot commented on Nov 11, 2025

    @flutter-triage-bot

    This issue is assigned to @LongCatIsLooong but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks!

  20. removed
    triaged-text-input
    on Jan 27, 2026
  21. flutter-triage-bot commented on Jan 27, 2026

    @flutter-triage-bot

    This issue was assigned to @LongCatIsLooong but has had no status updates in a long time. To remove any ambiguity about whether the issue is being worked on, the assignee was removed.

  22. removed
    ⏳
    on Jan 27, 2026
  23. added
    triaged-text-input
    on Jan 29, 2026
  24. kaling852 commented on Apr 10, 2026

    @kaling852

    this issue still existing in 3.41.2

    Environment:
    Flutter 3.41.2 (stable, latest)
    Dart 3.11.0
    Device: Pixel 10, Android 16 (API 36)
    Android SDK 36.1.0

    On Android, when a TextField with autofillHints (e.g. AutofillHints.telephoneNumber or AutofillHints.oneTimeCode) receives focus, the system autofill popup appears. After the user types the first character, the autofill popup is dismissed, which triggers PHASE_CLIENT_ON_CONTROLS_CHANGED — this cancels the IME and destroys the TextInputConnection, closing the keyboard.

    Setting autofillHints to an empty list confirms this is caused by the autofill framework because without it, the keyboard stays open as expected.

    Logcat output after first keystroke:

    D/Autofill Status: Autofill popup was hidden.
    I/ImeTracker: onCancelled at PHASE_CLIENT_ON_CONTROLS_CHANGED
    D/InsetsController: hide(ime())
    D/InsetsController: Setting requestedVisibleTypes to 503 (was 511)
    D/VRI[MainActivity]: WindowInsets changed: ime:null
    D/FlutterJNI: Sending viewport metrics to the engine. (×27)
    W/RemoteInputConnectionImpl: requestCursorUpdates on inactive InputConnection
    
  25. prefanatic commented on Jul 17, 2026

    @prefanatic
    Contributor

    I've opened up #189662, which aims to address and resolve this issue. cc @darshankawar

  26. added
    package
    and removed
    framework
    on Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2a: internationalizationa: text inputfound in release: 3.24found in release: 3.27has reproducible stepsp: material_uipackageplatform-androidteam-text-inputtriaged-text-input

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions