-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
flutter/engine
#20620Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projecta: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsfound in release: 1.21Found to occur in 1.21Found to occur in 1.21platform-webWeb applications specificallyWeb applications specifically
Description
Description
If an TextField with the autofill parameter (this is important) gets an error from a StreamBuilder / FutureBuilder the cursor goes to the start of the TextField and it isn't possible to type anything new.
Steps to Reproduce
Code to reproduce
import 'dart:math';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
Future<int> throwExecptionAfter3Seconds() async {
await Future.delayed(const Duration(seconds: 3));
throw Random().nextInt(1000);
}
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Demo',
home: Material(
child: Padding(
padding: const EdgeInsets.all(32),
child: Center(
child: FutureBuilder<void>(
future: throwExecptionAfter3Seconds(),
builder: (context, snapshot) {
return TextField(
autofillHints: [AutofillHints.email], // Bug works only with this line!
decoration:
InputDecoration(errorText: snapshot.error?.toString()),
);
},
),
),
),
),
);
}
}
- Run code.
- Type something before the error (from
FutureBuilder) is thrown --> error will be thrown after 3 seconds. - See that cursor at the beginning and typing isn't possible anymore.
Flutter doctor
Flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 1.21.0-10.0.pre.55, on Mac OS X 10.15.5 19F101,
locale en-DE)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
[✓] Chrome - develop for the web
[✓] Android Studio (version 3.6)
[✓] VS Code (version 1.47.3)
[✓] Connected device (4 available)
! Error: iPhone von Roland is not connected. Xcode will continue when iPhone
von Roland is connected. (code -13)
• No issues found!
Jonas-Sander, kunit1 and nilsreichardt
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projecta: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsfound in release: 1.21Found to occur in 1.21Found to occur in 1.21platform-webWeb applications specificallyWeb applications specifically
