Repository navigation
TextInputClient in macOS doesn't update the editingValue except for inserting characters #82124
Description
Activity
- addedin triagePresently being triaged by the triage teamPresently being triaged by the triage team
on May 10, 2021 Thanks for the detailed report and code sample. I see the same behavior.
An Observatory debugger and profiler on macOS is available at: http://127.0.0.1:53476/x2YvtWbVytw=/ The Flutter DevTools debugger and profiler on macOS is available at: http://127.0.0.1:9100?uri=http%3A%2F%2F127.0.0.1%3A53476%2Fx2YvtWbVytw%3D%2F flutter: value => TextEditingValue(text: ┤a├, selection: TextSelection(baseOffset: 1, extentOffset: 1, affinity: TextAffinity.upstream, isDirectional: false), composing: TextRange(start: -1, end: -1)) flutter: value => TextEditingValue(text: ┤ab├, selection: TextSelection(baseOffset: 2, extentOffset: 2, affinity: TextAffinity.upstream, isDirectional: false), composing: TextRange(start: -1, end: -1)) flutter: value => TextEditingValue(text: ┤abc├, selection: TextSelection(baseOffset: 3, extentOffset: 3, affinity: TextAffinity.upstream, isDirectional: false), composing: TextRange(start: -1, end: -1)) flutter: value => TextEditingValue(text: ┤abcd├, selection: TextSelection(baseOffset: 4, extentOffset: 4, affinity: TextAffinity.upstream, isDirectional: false), composing: TextRange(start: -1, end: -1)) flutter: value => TextEditingValue(text: ┤abcde├, selection: TextSelection(baseOffset: 5, extentOffset: 5, affinity: TextAffinity.upstream, isDirectional: false), composing: TextRange(start: -1, end: -1)) flutter: value => TextEditingValue(text: ┤abcdee├, selection: TextSelection(baseOffset: 6, extentOffset: 6, affinity: TextAffinity.upstream, isDirectional: false), composing: TextRange(start: -1, end: -1)) flutter: value => TextEditingValue(text: ┤abcdeef├, selection: TextSelection(baseOffset: 7, extentOffset: 7, affinity: TextAffinity.upstream, isDirectional: false), composing: TextRange(start: -1, end: -1)) flutter: value => TextEditingValue(text: ┤abcdeefg├, selection: TextSelection(baseOffset: 8, extentOffset: 8, affinity: TextAffinity.upstream, isDirectional: false), composing: TextRange(start: -1, end: -1))flutter doctor -v
[✓] Flutter (Channel master, 2.3.0-1.0.pre.269, on Mac OS X 10.15.4 19E2269 darwin-x64, locale en-GB) • Flutter version 2.3.0-1.0.pre.269 at /Users/dhs/documents/fluttersdk/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision d28737eedf (10 hours ago), 2021-05-09 14:24:19 -0700 • Engine revision f5b97d0b23 • Dart version 2.14.0 (build 2.14.0-74.0.dev) [!] Xcode - develop for iOS and macOS • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 12.3, Build version 12C33 ! CocoaPods 1.9.3 out of date (1.10.0 is recommended). CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side. Without CocoaPods, plugins will not work on iOS or macOS. For more info, see https://flutter.dev/platform-plugins To upgrade see https://guides.cocoapods.org/using/getting-started.html#installation for instructions. [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] VS Code (version 1.55.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.21.0 [✓] Connected device (3 available) • iPhone 12 Pro Max (mobile) • A5473606-0213-4FD8-BA16-553433949729 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator) • macOS (desktop) • macos • darwin-x64 • Mac OS X 10.15.4 19E2269 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 90.0.4430.93 ! Doctor found issues in 1 category.- addeda: desktopRunning on desktopRunning on desktopa: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsa: typographyText rendering, possibly libtxtText rendering, possibly libtxtengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.found in release: 2.3Found to occur in 2.3Found to occur in 2.3has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onand removedin triagePresently being triaged by the triage teamPresently being triaged by the triage team
on May 10, 2021 We have changed the text input so that the text editing operations are handled by the shortcuts layer instead of the engine, so perhaps there is something special about macOS in that new code that needs addressing here (that TextField is addressing).
- addedP2Important issues not at the top of the work listImportant issues not at the top of the work list
on May 13, 2021 The arrow related keys are now handled by Shortcuts as Greg mentioned, which is at the EditableText level, so without an EditableText I wouldn't expect them to work. The other keys mentioned above are still handled by a RawKeyboard listener in RenderEditable (here), but they should be ported to Shortcuts soon.
@osaxma Have you tried this on another desktop platform like Windows/Linux? I wonder if it works. I also wonder what TextInputClient is supposed to be doing here and if we need it to receive all of these key events or not.
- addedplatform-macosBuilding on or for macOS specificallyBuilding on or for macOS specifically
on Apr 18, 2023 - addedteam-macosOwned by the macOS platform teamOwned by the macOS platform teamand removed
on Jun 5, 2024 The
triaged-desktoplabel is irrelevant if there is noteam-desktoplabel orfyi-desktoplabel.- addedfyi-text-inputFor the attention of Text Input teamFor the attention of Text Input team
on Jun 6, 2024 - addedtriaged-macosTriaged by the macOS platform teamTriaged by the macOS platform team
on Jun 7, 2024 - addedtriaged-text-inputTriaged by Text Input teamTriaged by Text Input team
on Oct 9, 2025 - removedfyi-text-inputFor the attention of Text Input teamFor the attention of Text Input teamtriaged-text-inputTriaged by Text Input teamTriaged by Text Input team
on Oct 9, 2025
When creating a custom
TextInputClient, macOS does not update the editingValue for the following keystrokes:The last three were not tested since I'm unable to make a selection with either
shift + arrowsorcmd+a.Steps to Reproduce
using the code sample provided below, run the following sequence:
abcdeefgcmd + a(nothing happen on macOS)cmd + c(nothing happen on macOS)Expected results:
I expected the following result which was produced with the same steps on the web platform.
Actual results:
Minimal Code Sample
flutter doctor -v
side note:
I'm not sure if I'm missing something out since
TextFieldworks fine. I tried to look at theEditableTextimplementation to see if there's anything unique about macOS or desktop but I couldn't find such indication. Nevertheless, given that the same provided sample code works forweb, I was expecting the same behavior onmacOS. Please advise.