Repository navigation
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.found in release: 3.19Found to occur in 3.19Found to occur in 3.19found in release: 3.20Found to occur in 3.20Found to occur in 3.20frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.fyi-text-inputFor the attention of Text Input teamFor the attention of Text Input teamhas reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyiOS applications specificallyteam-iosOwned by iOS platform teamOwned by iOS platform teamtriaged-iosTriaged by iOS platform teamTriaged by iOS platform team
Description
Steps to reproduce
App is launched on iOS 17.2 (reproduces both on a simulator and on a real device)
- Select text in Text Field
- Press Look up
- Close the Look up dialog
Expected results
Keyboard hides or text field returns its focus
Actual results
Keyboard persists on screen, but the text field does not retain focus and keyboard does not hide via unfocus() (see video)
Code sample
Code sample
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
useMaterial3: true,
),
home: const MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key});
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const TextField(),
TextButton(
onPressed: () => FocusScope.of(context).unfocus(),
child: const Text('FocusScope.of(context).unfocus()'),
),
TextButton(
onPressed: () => FocusManager.instance.primaryFocus?.unfocus(),
child:
const Text('FocusManager.instance.primaryFocus?.unfocus()'),
),
],
),
),
);
}
}
Screenshots or Video
Screenshots / Video demonstration
Screenshot.2024-03-01.at.14.11.27.mp4
Logs
Logs
no logsFlutter Doctor output
Doctor output
[flutter] flutter doctor -v
[!] Flutter (Channel stable, 3.19.2, on macOS 14.3.1 23D60 darwin-arm64, locale ru-RU)
• Flutter version 3.19.2 on channel stable at /Users/viktorstarikov/fvm/versions/3.19.2
! Warning: `flutter` on your path resolves to /Users/viktorstarikov/fvm/versions/3.10.4/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/viktorstarikov/fvm/versions/3.19.2. Consider adding /Users/viktorstarikov/fvm/versions/3.19.2/bin to the front of your path.
! Warning: `dart` on your path resolves to /opt/homebrew/Cellar/dart/3.0.1/libexec/bin/dart, which is not inside your current Flutter SDK checkout at /Users/viktorstarikov/fvm/versions/3.19.2. Consider adding /Users/viktorstarikov/fvm/versions/3.19.2/bin to the front of your path.
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 7482962148 (2 days ago), 2024-02-27 16:51:22 -0500
• Engine revision 04817c99c9
• Dart version 3.3.0
• DevTools version 2.31.1
• If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
• Android SDK at /Users/viktorstarikov/Library/Android/sdk
• Platform android-33, build-tools 33.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
• Xcode at /Applications/Xcode-15.2.0.app/Contents/Developer
• Build 15C500b
• CocoaPods version 1.13.0
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2023.1)
• 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 17.0.7+0-17.0.7b1000.6-10550314)
[✓] VS Code (version 1.86.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.82.0
[✓] Connected device (5 available)
• sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64 • Android 13 (API 33) (emulator)
• iPhone 6s Plus (mobile) • 00008110-000A388A3AF9801E • ios • iOS 17.2.1 21C66
• iPhone 15 Pro Max (mobile) • 97CAF3A4-246E-462F-968B-A414DE0A3445 • ios • com.apple.CoreSimulator.SimRuntime.iOS-17-2 (simulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 14.3.1 23D60 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 122.0.6261.94
! Error: Browsing on the local area network for Apple Watch — Viktor. Ensure the device is unlocked and discoverable via Bluetooth. (code -27)
[✓] Network resources
• All expected network resources are available.
! Doctor found issues in 1 category.
Reacted by Aizuddin Ismail, Ahmed Elsayed, Mohamed Salah, Teppei Shimada and Francesc Reig Leadtech
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.found in release: 3.19Found to occur in 3.19Found to occur in 3.19found in release: 3.20Found to occur in 3.20Found to occur in 3.20frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.fyi-text-inputFor the attention of Text Input teamFor the attention of Text Input teamhas reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyiOS applications specificallyteam-iosOwned by iOS platform teamOwned by iOS platform teamtriaged-iosTriaged by iOS platform teamTriaged by iOS platform team
Activity
danagbemava-nc commentedon Mar 1, 2024
Reproducible using the code sample provided above.
With the native iOS notes and reminders app, the behaviours are different. Notes dismisses the keyboard whereas reminders refocuses the keyboard. See the recordings below
It looks like the lookUpSelection method in the framework doesn't handle anything else after calling the method to invoke the look up window.
flutter/packages/flutter/lib/src/widgets/editable_text.dart
Lines 2598 to 2609 in e8f8a8d
RPReplay_Final1709287250.MP4
RPReplay_Final1709287076.MP4
RPReplay_Final1709285659.MP4
flutter doctor -v
hellohuanlin commentedon Mar 5, 2024
can take a look if it's possible to track what was on focus before presenting the lookup window, and then regain the focus after look up window is dismissed (not sure if there's a delegate callback we can use when look up window is dismissed)
cc @LouiseHsu
22 remaining items
Renzo-Olivares commentedon Aug 28, 2025
From triage: maybe this is related to shake to undo causing the TextField possibly to lose focus and not process the undo action #150522.
LongCatIsLooong commentedon Aug 28, 2025
The native text field must not close the input connection in these cases so it can receive undo commands even after losing focus.
flutter-triage-bot commentedon Jan 2, 2026
This issue is assigned to @okorohelijah but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks!
okorohelijah commentedon Mar 16, 2026
Added a comment in #173846 (comment)
flutter-triage-bot commentedon Jul 21, 2026
This issue is assigned to @okorohelijah but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks!
LongCatIsLooong commentedon Sep 24, 2026
I think #191781 fixes this.
github-actions commentedon Nov 4, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.