Skip to content

[web] TextField inside TableRow without TableCell wrapper does not accept input on web when semantics are enabled #170575

@liubou-s-inno

Description

@liubou-s-inno

Steps to reproduce

Description

On Flutter Web, when a TextField is placed directly inside a TableRow (i.e., not wrapped in a TableCell), the text field does not accept any input when accessibility semantics are enabled. The text field appears focusable: the caret is visible, and the field gains focus as expected. However, when the user types, no text appears in the field.

Steps to Reproduce

  1. Create a Table with a TableRow containing a TextField directly (not wrapped in TableCell).
  2. Enable semantics with SemanticsBinding.instance.ensureSemantics().
  3. Attempt to focus and type into the field.

Workarounds

  • Wrapping the TextField in a TableCell resolves the issue.

However, the documentation for TableRow.children states:

Children may be wrapped in TableCell widgets to provide per-cell configuration to the Table, but children are not required to be wrapped in TableCell widgets.

This suggests that TableCell wrapping should be optional.

Expected results

The TextField should accept input as normal, regardless of whether it is wrapped in a TableCell.

Actual results

On web, the TextField gains focus but does not respond to keyboard input when not wrapped in a TableCell.

Code sample

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

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  SemanticsBinding.instance.ensureSemantics();

  runApp(const MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Table(
          children: [
            TableRow(
              children: [
                TableCell(
                  child: TextField(),
                ),
              ],
            ),
          ],
        ),
      ),
    );
  }
}

Screenshots or Video

Logs

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.32.3, on macOS 14.6.1 23G93 darwin-arm64, locale en-US) [519ms]
    • Flutter version 3.32.3 on channel stable at /Users/user/Developer/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5c1433509f (2 days ago), 2025-06-11 13:12:24 -0700
    • Engine revision 31c4875c7a
    • Dart version 3.8.1
    • DevTools version 2.45.1

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [1,837ms]
    • Android SDK at /Users/user/Library/Android/sdk
    • Platform android-35, build-tools 35.0.0
    • Java binary at: /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.4+-12422083-b607.1)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4) [1,061ms]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15F31d
    • CocoaPods version 1.16.2

[✓] Chrome - develop for the web [30ms]
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.2) [29ms]
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 21.0.4+-12422083-b607.1)

[✓] IntelliJ IDEA Community Edition (version 2024.2.3) [28ms]
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] Connected device (3 available) [11.4s]
    • iPhone 15 Pro Max (mobile) • 8C684370-7222-4C78-A294-767809F4010E • ios            • com.apple.CoreSimulator.SimRuntime.iOS-17-5 (simulator)
    • macOS (desktop)            • macos                                • darwin-arm64   • macOS 14.6.1 23G93 darwin-arm64
    • Chrome (web)               • chrome                               • web-javascript • Google Chrome 137.0.7151.104

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

• No issues found!

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: text inputEntering text in a text field or keyboard related problemsc: regressionIt was better in the past than it is nowf: material designflutter/packages/flutter/material repository.found in release: 3.32Found to occur in 3.32found in release: 3.33Found to occur in 3.33frameworkflutter/packages/flutter repository. See also f: labels.fyi-accessibilityFor the attention of Framework Accessibility teamhas reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-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