Repository navigation
Open
Labels
P2Important issues not at the top of the work lista: text inputEntering text in a text field or keyboard related problemshas reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyplatform-iosiOS applications specificallyteam-text-inputOwned by Text Input teamtriaged-text-inputTriaged by Text Input team
Description
Steps to reproduce
- Have some Flutter code that changes
textInputActionof aTextFieldat runtime while a TextField is focused and the keyboard is up - Do something that changes textInputAction value
Expected results
iOS keyboard action button style should change to match the new value
Actual results
iOS keyboard action button style does not change while the TextField remains in focus
Code sample
Code sample
The bug is probably a duplicate of #97253 on a low level, but I am using a higher level API, so I decided to submit a new issue with a different repro.
import 'package:flutter/material.dart';
void main() {
runApp(const TextInputActionReproApp());
}
class TextInputActionReproApp extends StatelessWidget {
const TextInputActionReproApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(home: TextInputActionReproPage());
}
}
class TextInputActionReproPage extends StatefulWidget {
const TextInputActionReproPage({super.key});
@override
State<TextInputActionReproPage> createState() =>
_TextInputActionReproPageState();
}
class _TextInputActionReproPageState extends State<TextInputActionReproPage> {
final _controller = TextEditingController();
final _focusNode = FocusNode();
String _lastSubmittedValue = '(none)';
@override
void dispose() {
_controller.dispose();
_focusNode.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
final hasText = _controller.text.trim().isNotEmpty;
// This is correctly recomputed during each build, but changes are not
// applied to native iOS keyboard until the text field unfocuses.
final requestedAction = hasText
? TextInputAction.send
: TextInputAction.done;
return Scaffold(
appBar: AppBar(title: const Text('TextInputAction Repro')),
body: SafeArea(
child: Padding(
padding: const EdgeInsets.all(24),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Text(
'Requested textInputAction:',
style: Theme.of(context).textTheme.titleMedium,
),
const SizedBox(height: 8),
Text(
requestedAction.toString(),
style: Theme.of(context).textTheme.headlineSmall,
),
const SizedBox(height: 24),
TextField(
controller: _controller,
focusNode: _focusNode,
autofocus: true,
decoration: const InputDecoration(
border: OutlineInputBorder(),
labelText: 'Type here, then clear the field',
),
// THIS IS THE BUG: when requestedAction changes, iOS keyboard action
// does not change until the field is unfocused and refocused.
textInputAction: requestedAction,
onChanged: (_) => setState(() {}),
onSubmitted: (value) {
setState(() {
_lastSubmittedValue = value;
});
},
),
const SizedBox(height: 16),
FilledButton(
onPressed: () {
_controller.clear();
setState(() {});
_focusNode.requestFocus();
},
child: const Text('Clear and keep focus'),
),
const SizedBox(height: 24),
Text('Last submitted value: $_lastSubmittedValue'),
const Spacer(),
const Text(
'On iOS, the label above changes between done and send as the '
'text changes, but the keyboard return key does not update '
'until the text input connection is recreated.',
),
],
),
),
),
);
}
}Screenshots or Video
Screenshots / Video demonstration
Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-04-23.11.15.23.mp4
Logs
Logs
n/a
Flutter Doctor output
Doctor output
jaanus@jk-mbp ~/D/F/text_input_action_mre> flutter doctor -v
[✓] Flutter (Channel stable, 3.38.1, on macOS 26.4.1 25E253 darwin-arm64, locale et-EE) [1 132ms]
• Flutter version 3.38.1 on channel stable at /Users/jaanus/fvm/versions/3.38.1
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision b45fa18946 (5 months ago), 2025-11-12 22:09:06 -0600
• Engine revision b5990e5ccc
• Dart version 3.10.0
• DevTools version 2.51.1
• Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios,
no-cli-animations, enable-native-assets, enable-swift-package-manager, omit-legacy-version-file, enable-lldb-debugging
[✓] Android toolchain - develop for Android devices (Android SDK version 36.0.0) [2,7s]
• Android SDK at /Users/jaanus/Library/Android/sdk
• Emulator version 36.1.9.0 (build_id 13823996) (CL:N/A)
• Platform android-36, build-tools 36.0.0
• ANDROID_HOME = /Users/jaanus/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment (build 21.0.7+-13880790-b1038.58)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 26.3) [2,6s]
• Xcode at /Applications/Xcode-26.3.app/Contents/Developer
• Build 17C529
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web [7ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Connected device (4 available) [7,5s]
• Pixel 6 (mobile) • 21101FDF60088E • android-arm64 • Android 16 (API 36)
• iPhone 17 Pro (mobile) • 4B67BFD5-3197-4042-A7D4-2854280598F7 • ios • com.apple.CoreSimulator.SimRuntime.iOS-26-3
(simulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 26.4.1 25E253 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 147.0.7727.102
! Error: Browsing on the local area network for JK iPhone 15 Pro. Ensure the device is unlocked and attached with a cable or
associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
! Error: Browsing on the local area network for JK iPhone 17 Pro. Ensure the device is unlocked and attached with a cable or
associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
! Error: Browsing on the local area network for Ultra 2. Ensure the device is unlocked and discoverable via Bluetooth. (code
-27)
! Error: Browsing on the local area network for 15. Ensure the device is unlocked and attached with a cable or associated with
the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources [188ms]
• All expected network resources are available.
• No issues found!
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work lista: text inputEntering text in a text field or keyboard related problemshas reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyplatform-iosiOS applications specificallyteam-text-inputOwned by Text Input teamtriaged-text-inputTriaged by Text Input team
Activity
mbcorona commentedon Apr 23, 2026
Hi @jaanus , thank you for the detailed report and for including a code sample that reproduces the issue.
Reproducible on Flutter 3.41.7
Routing to team-text-input for investigation.
justinmc commentedon Apr 23, 2026
@mbcorona Are you able to reproduce this on any platform other than iOS? @LongCatIsLooong had a hunch that this was due to the framework not sending updates to the platform.
mbcorona commentedon Apr 23, 2026
@justinmc I was able to replicate also on Android simulator, sharing video findings:
Screen.Recording.2026-04-23.at.2.43.58.PM.mov
And adding platform-android
LongCatIsLooong commentedon Apr 23, 2026
Removing fyi-ios: this is likely because the framework does not call
updateConfigwhen input action changes: https://github.com/flutter/flutter/blob/main/packages/flutter/lib/src/widgets/editable_text.dart[-]TextField inputAction changes do not get applied on iOS while TextField is focused[/-][+]TextField inputAction changes do not get applied while TextField is focused[/+]Istiak-Ahmed78 commentedon Apr 25, 2026
I was able to reproduce the issue on my Android Device and noticed a consistent pattern:
The keyboard action button does not update in real time. It only corrects itself after pressing the (incorrect) action button and refocusing the text field. However, this correction does not happen when dismissing the keyboard via the back button or by tapping outside the field.
Istiak-Ahmed78 commentedon Apr 25, 2026
previously it would update the
configonly if obscureText , keyboardType updates.// Code before this fix
I added another check:
textInputActionChanged = oldWidget.textInputAction != widget.textInputAction;.But unfortunately this also did not help. even though the
textInputActionChangedwas detected, updateConfig was being called but the action button on the keyboard UI doesnot get updated. However, restarting the connection resolved the issue whentextInputActionChangeddetectedLets discuss further in the PR #185582
flutter-triage-bot commentedon Apr 25, 2026
The
triaged-frameworklabel is irrelevant if there is noteam-frameworklabel orfyi-frameworklabel.flutter-triage-bot commentedon Aug 31, 2026
This issue is assigned to @Istiak-Ahmed78 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!