-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
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
- Create a
Tablewith aTableRowcontaining aTextFielddirectly (not wrapped inTableCell). - Enable semantics with
SemanticsBinding.instance.ensureSemantics(). - Attempt to focus and type into the field.
Workarounds
- Wrapping the
TextFieldin aTableCellresolves the issue.
However, the documentation for TableRow.children states:
Children may be wrapped in
TableCellwidgets to provide per-cell configuration to theTable, but children are not required to be wrapped inTableCellwidgets.
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!