Repository navigation
Description
Software keyboards have an "action button". It often shows a message like "Done", "Search", or shows a newline icon. This button can be configured as needed by an app. Flutter provides an API to configure this button when the keyboard first opens, as well as an API to change the button after the keyboard is already open.
Flutter's API to change the button after the keyboard has opened doesn't work.
Here's a Flutter snippet that provides an initial keyboard configuration and shows the keyboard:
_inputConnection = TextInput.attach(
this, // or whatever you have that implements TextInputClient
TextInputConfiguration(
enableDeltaModel: true,
inputAction: TextInputAction.newline,
// possibly other configurations
),
);
_inputConnection!
..show()
..setEditingState(/* pass in some initial editing value */);Once the keyboard is visible, an app should be able to change the action button using the following code, but the button doesn't change:
_inputConnection.updateConfig(
TextInputConfiguration(
enableDeltaModel: true,
inputAction: TextInputAction.done,
// possibly other configurations
),
);Expected result: When the 2nd snippet executes, the keyboard changes its action button from a newline icon to a "Done" button.
Actual result: When the 2nd snippet executes, the action button doesn't change.
I've reproduced this issue on:
- iOS simulator (iOS 15.0)
- iPhone 7 (iOS 13.6.1)
- Android emulator (Android 10 - AKA API 29)
- Pixel 4a (Android 12)
Flutter version:
Flutter 2.8.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision cf44000065 (7 weeks ago) • 2021-12-08 14:06:50 -0800
Engine • revision 40a99c5951
Tools • Dart 2.15.0
Activity
maheshj01 commentedon Jan 26, 2022
Hi @matthew-carroll, Thanks for filing the issue. Can you please share a minimal and complete reproducible code sample that shows this behavior?
Thanks
justinmc commentedon Jan 26, 2022
I tried to reproduce this quickly using EditableText and it didn't show the keyboard. I think I need to create my own fake TextInputClient implementer to get it to work?
Code
matthew-carroll commentedon Jan 27, 2022
@justinmc are you using an iOS simulator? If so, did you try saying "Toggle Software Keyboard" from the simulator app menu? There can be some inconsistencies there.
If you ran on a physical device and it didn't open, then I'm not sure. It might depend on what that
Stateobject is doing that you passed in. In the case of super_editor, we have to implement that interface, so we pass in our own implementation.maheshj01 commentedon Jan 27, 2022
Thanks for the code sample @justinmc, I can reproduce this issue on stable and the master channel on calling
updateConfigI don't see any of the input control configuration getting updated neither on Android nor on IOS.Screen.Recording.2022-01-27.at.12.25.42.PM.mov
Screen.Recording.2022-01-27.at.12.13.58.PM.mov
Note: if the keyboard doesn't show up on IOS simulator then try pressing command + k
flutter doctor -v
code sample
tirth-patel-nc commentedon May 13, 2025
Triage Report
I was able to reproduce the issue using the provided code sample on both the
stable (3.29.3)andmaster (3.32.0-1.0.pre.514)channels.screen-20250513-162559.mp4
Simulator.Screen.Recording.-.iPhone.16.Plus.-.2025-05-13.at.16.25.06.mp4
Code Sample
stable (3.29.3) - flutter doctor -v
master (3.32.0-1.0.pre.514) - flutter doctor -v