TextField: The container does not disappear from autocorrection
- Dominant language
- Dart
- Stars
- 179k
- Forks
- 31.1k
- PR merge metrics
- PR metrics pending
Description
### Is there an existing issue for this?
- [X] I have searched the [existing issues](https://github.com/flutter/flutter/issues)
- [X] I have read the [guide to filing a bug](https://flutter.dev/docs/resources/bug-reports)
### Steps to reproduce
1. write a word in the input field to call up the auto-correction rectangle
2. hide app
3. open the application
4. hide keyboard
### Expected results
--
### Actual results
https://github.com/flutter/flutter/assets/38835822/0eb9b3e9-ead6-4247-b841-e90d8a91013e
### Code sample
Code sample
```dart
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:path/path.dart' as path;
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Playground',
home: AutoCorrectTest(),
);
}
}
class AutoCorrectTest extends StatefulWidget {
@override
_AutoCorrectTestState createState() => _AutoCorrectTestState();
}
class _AutoCorrectTestState extends State {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('TextField example'),
),
body: Padding(
padding: EdgeInsets.all(16.0),
child: Column(
children: [
TextField(
),
ElevatedButton(onPressed: () {
FocusScope.of(context).requestFocus(FocusNode());
}, child: const Text('Hide keyboard')),
ElevatedButton(onPressed: () {
Navigator.of(context).push(MaterialPageRoute(builder: (context) => Scaffold(appBar: AppBar(),body: Text('new page'),)));
}, child: const Text('Go to nextPage'))
],
)
),
);
}
}```
### Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
### Logs
Logs
```console
[Paste your logs here]
```
### Flutter Doctor output
Doctor output
```console
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.13.8, on macOS 14.0 23A344 darwin-arm64, locale ru-RU)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.2)
[✓] Android Studio (version 2021.2)
[✓] Connected device (4 available)
[✓] Network resources
• No issues found!
```
Contributor guide
Assessment
This issue has not been assessed yet.