-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: desktopRunning on desktopRunning on desktopa: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsfound in release: 3.35Found to occur in 3.35Found to occur in 3.35found in release: 3.38Found to occur in 3.38Found to occur in 3.38frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-text-inputOwned by Text Input teamOwned by Text Input team
Description
Steps to reproduce
- Run the code sample on desktop.
- Set the focus to another window.
- Come back the Flutter application.
- Press tab.
- Observe the selection for the second TextField.
Expected results
The whole content of the second TextField is selected:
Screen.Recording.2025-10-28.at.13.48.58.mov
Actual results
The previous selection is used (selection collapsed at end as set initially in the code):
Screen.Recording.2025-10-28.at.13.48.22.mov
Code sample
Code sample
import 'package:flutter/material.dart';
void main() => runApp(const ReproApp());
class ReproApp extends StatefulWidget {
const ReproApp({super.key});
@override
State<ReproApp> createState() => _ReproAppState();
}
class _ReproAppState extends State<ReproApp> {
static TextEditingValue collapsedAtEnd(String text) {
return TextEditingValue(
text: text,
selection: TextSelection.collapsed(offset: text.length),
);
}
final TextEditingController controller1 = TextEditingController.fromValue(
collapsedAtEnd('Flutter!!!'),
);
final TextEditingController controller2 = TextEditingController.fromValue(
collapsedAtEnd('Dart!!!'),
);
@override
void dispose() {
controller1.dispose();
controller2.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Column(
children: [
TextField(autofocus: true, controller: controller1),
TextField(controller: controller2),
],
),
),
);
}
}
Screenshots or Video
No response
Logs
Flutter Doctor output
Doctor output
Flutter (Channel [user-branch], 3.38.0-1.0.pre-246, on macOS 15.6.1 24G90 darwin-arm64, locale en-FR)Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: desktopRunning on desktopRunning on desktopa: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsfound in release: 3.35Found to occur in 3.35Found to occur in 3.35found in release: 3.38Found to occur in 3.38Found to occur in 3.38frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-text-inputOwned by Text Input teamOwned by Text Input team
Type
Projects
Status
Done (PR merged)