Repository navigation
[iOS] Keyboard dismisses and reopens when switching focus between TextFields - regression in 3.41.0 #184875
Copy link
Copy link
Closed
Labels
r: solvedIssue is closed as solvedIssue is closed as solved
Description
Flutter version
- Affected: 3.41.0 → 3.41.6
- Not affected: 3.38.10 (and presumably earlier)
Platform
iOS (physical device and simulator). Not tested on Android.
Describe the bug
When switching focus between TextField widgets — either by tapping directly on another field or by pressing the "Next" key on the keyboard — the keyboard briefly dismisses and reopens instead of staying visible with only the focus changing.
This is a regression: the same screen and code works correctly on Flutter 3.38.10 without any workarounds.
Steps to reproduce
- Create a screen with 2+
TextFieldwidgets in sequence, withTextInputAction.nexton all but the last - Run on a physical iOS device (or simulator)
- Tap the first
TextField→ keyboard appears - Tap the second
TextFielddirectly → keyboard flashes (closes and reopens) - Alternatively, press the "Next" key on the keyboard → same flash, more noticeable
Expected behavior
Keyboard stays visible, only the focus moves to the next field — as it did on Flutter 3.38.10.
Actual behavior
The keyboard briefly dismisses and reopens on every focus change between fields. The flash is particularly noticeable when using the "Next" key.
Minimal reproduction
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(home: KeyboardRegressionScreen());
}
}
class KeyboardRegressionScreen extends StatefulWidget {
const KeyboardRegressionScreen({super.key});
@override
State<KeyboardRegressionScreen> createState() => _KeyboardRegressionScreenState();
}
class _KeyboardRegressionScreenState extends State<KeyboardRegressionScreen> {
final _firstNameFocus = FocusNode();
final _lastNameFocus = FocusNode();
final _phoneFocus = FocusNode();
@override
void dispose() {
_firstNameFocus.dispose();
_lastNameFocus.dispose();
_phoneFocus.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
body: Padding(
padding: const EdgeInsets.all(24.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
TextField(
focusNode: _firstNameFocus,
textInputAction: TextInputAction.next,
decoration: const InputDecoration(labelText: 'Nome'),
onSubmitted: (_) => _lastNameFocus.requestFocus(),
),
const SizedBox(height: 16),
TextField(
focusNode: _lastNameFocus,
textInputAction: TextInputAction.next,
decoration: const InputDecoration(labelText: 'Cognome'),
onSubmitted: (_) => _phoneFocus.requestFocus(),
),
const SizedBox(height: 16),
TextField(
focusNode: _phoneFocus,
textInputAction: TextInputAction.done,
keyboardType: TextInputType.phone,
decoration: const InputDecoration(labelText: 'Telefono'),
),
],
),
),
);
}
}Additional context
- Confirmed regression by downgrading to Flutter 3.38.10: issue disappears completely without any code changes
- The iOS console shows
NSLayoutConstraintwarnings related toTUIKeyboardContentViewduring the transition — these were not present on 3.38.10 - Tested on a screen using standard
TextFieldwithFocusNodes andTextInputAction.next
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
r: solvedIssue is closed as solvedIssue is closed as solved
Activity
puneetkukreja98 commentedon Apr 10, 2026
@nixonoftheyear Thanks for reporting the issue. The fix for this has already been merged into the master branch #180842
It hasn't reached the stable channel yet, but I've verified it on the master branch and the issue is no longer reproducible—it's working fine.
Please wait a few weeks ,it should be available on the stable channel soon.
Thanks
Flutter doctor -v:
github-actions commentedon Apr 24, 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.