Skip to content

[Android] Software keyboard backspace makes focus highlightMode invalid #180746

Description

@romaingyh

Steps to reproduce

  1. flutter create --platforms android highlightMode
  2. Copy paste the code sample below
  3. Start android simulator phone
  4. flutter run
  5. Touch the textfield to open the software keyboard and enter some text
  6. Delete a letter with backspace
  7. Observe the FocusHighlightMode become traditional

Expected results

The focus highlightMode should stay FocusHighlightMode.touch

Actual results

The focus highlightMode becomes FocusHighlightMode.traditional when pressing the backspace

Code sample

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(title: 'Flutter Demo', home: const MyHomePage());
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

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

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    final mode = FocusManager.instance.highlightMode;

    return Scaffold(
      body: Column(
        spacing: 32,
        mainAxisAlignment: .center,
        children: [
          Text(mode.toString()),
          TextField(onChanged: (_) => setState(() {})),
        ],
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
✓] Flutter (Channel stable, 3.38.5, on macOS 26.2 25C56 darwin-arm64, locale fr-FR) [587ms]
    • Flutter version 3.38.5 on channel stable at /Users/romanojw10/.puro/envs/stable/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f6ff1529fd (4 weeks ago), 2025-12-11 11:50:07 -0500
    • Engine revision 1527ae0ec5
    • Dart version 3.10.4
    • DevTools version 2.51.1
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations,
      enable-native-assets, omit-legacy-version-file, enable-lldb-debugging

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [2,1s]
    • Android SDK at /Users/romanojw10/Library/Android/sdk
    • Emulator version 35.4.9.0 (build_id 13025442) (CL:N/A)
    • Platform android-36, build-tools 35.0.0
    • ANDROID_HOME = /Users/romanojw10/Library/Android/sdk
    • Java binary at: /Users/romanojw10/Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.7+-13880790-b1038.58)
    • All Android licenses accepted.

[!] Xcode - develop for iOS and macOS (Xcode 26.2) [693ms]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 17C52
    ✗ CocoaPods not installed.
        CocoaPods is a package manager for iOS or macOS platform code.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/to/platform-plugins
      For installation instructions, see https://guides.cocoapods.org/using/getting-started.html#installation

[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome) [14ms]
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Connected device (2 available) [7,0s]
    • sdk gphone64 arm64 (mobile)                • emulator-5554             • android-arm64 • Android 16 (API 36) (emulator)
    • macOS (desktop)                            • macos                     • darwin-arm64  • macOS 26.2 25C56 darwin-arm64

[✓] Network resources [325ms]
    • All expected network resources are available.

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 problemsf: focusFocus traversal, gaining or losing focusplatform-androidAndroid applications specificallyteam-text-inputOwned by Text Input teamtriaged-text-inputTriaged by Text Input teamwaiting for PR to land (fixed)A fix is in flight

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions