Skip to content

[WEB] TextField actions are not triggered on Android #89384

@franarolas

Description

@franarolas

I'm encountering a really strange issue as I haven't seen anyone reporting it and I think that it should be a P1 issue.
I've tested it in iOS through web server, it works properly, also I did built the app in Android and everything works fine, whatever it seems that it is not working with Android in Flutter web.

Steps to Reproduce

  1. Run the code below as a web-server and go to the website through an Android operating system and chrome browser:
import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Home(),
      ),
    );
  }
}

class Home extends StatefulWidget {
  const Home({Key? key}) : super(key: key);

  @override
  _HomeState createState() => _HomeState();
}

class _HomeState extends State<Home> {
  final _controller = TextEditingController();
  String text = 'Nothing pressed';

  @override
  Widget build(BuildContext context) {
    return SafeArea(
      child: Column(
        children: [
          Text(text),
          TextField(
            controller: _controller,
            textInputAction: TextInputAction.send,
            onEditingComplete: () => setState(() => text = 'onEditingComplete pressed'),
            onSubmitted: (value) => setState(() => text = 'onFieldSubmitted pressed'),
          ),
        ],
      ),
    );
  }
}

Expected results:
The onFieldSubmitted action is not triggered when there is text in the TextField(Same result with TextFormField).

Actual results:
Nothing is triggered.

Flutter doctor
[√] Flutter (Channel stable, 2.2.3, on Microsoft Windows [Versión 10.0.19042.1165], locale es-ES)
    • Flutter version 2.2.3 at C:\flutter
    • Framework revision f4abaa0735 (9 weeks ago), 2021-07-01 12:46:11 -0700
    • Engine revision 241c87ad80
    • Dart version 2.13.4

[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at C:\Users\frana\AppData\Local\Android\sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: C:\Program Files\Java\jdk1.8.0_301\bin\java.exe
    • Java version Java(TM) SE Runtime Environment (build 1.8.0_301-b09)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).

[√] IntelliJ IDEA Ultimate Edition (version 2021.2)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2021.2.1
    • Flutter plugin version 59.0.4
    • Dart plugin version 212.5080.8

[√] Connected device (3 available)
    • M2003J15SC (mobile) • 1996586a0403 • android-arm64  • Android 10 (API 29)
    • Chrome (web)        • chrome       • web-javascript • Google Chrome 93.0.4577.63
    • Edge (web)          • edge         • web-javascript • Microsoft Edge 92.0.902.84

! Doctor found issues in 1 category.

Metadata

Metadata

Assignees

Labels

a: text inputEntering text in a text field or keyboard related problemsassigned for triageissue is assigned to a domain expert for further triagefound in release: 2.2Found to occur in 2.2found in release: 2.6Found to occur in 2.6frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyplatform-webWeb applications specificallyr: fixedIssue is closed as already fixed in a newer version

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions