Open LiewJunTung opened 3 years ago
I was able to reproduce this issue.
cc @gspencergoog
cc @cbracken
Catching up on GitHub notifications -- /cc @justinmc who has the most recent context on text input on iOS.
To me it looks like we should finish the composing when the focus leaves the field. This would let the IME remove the space that it added. Currently we just clear the composing range (code).
I think that would mean adding a new platform channel method to request that the platform finish composing. On Android it would call [finishComposingText](https://developer.android.com/reference/android/view/inputmethod/InputConnection#finishComposingText()).
I encountered this bug when developing the login screen for an app. Where
myemail@email.com
will changed tomyemail@email.co m
when using a Chinese keyboard. This issue is not found on vanilla iOS application. This can be solved temporarily via setting theFilteringTextInputFormatter.deny(RegExp('[\\s]'))
.Steps to Reproduce
flutter create bug
.main.dart
to include the follow:Expected results: Created with a sample Swift UI project with 2 TextFields
https://user-images.githubusercontent.com/4220976/112440478-54ee4400-8d85-11eb-89f1-2ad5c6c002cb.MP4
Actual results:
https://user-images.githubusercontent.com/4220976/112440513-5f104280-8d85-11eb-8920-02601a71c339.MP4
Logs
``` ``` ``` ``` ``` [✓] Flutter (Channel stable, 2.0.3, on macOS 11.1 20C69 darwin-arm, locale en-GB) • Flutter version 2.0.3 at /Users/liewjuntung/Applications/flutter • Framework revision 4d7946a68d (6 days ago), 2021-03-18 17:24:33 -0700 • Engine revision 3459eb2436 • Dart version 2.12.2 [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at /Users/liewjuntung/Library/Android/sdk • Platform android-30, build-tools 30.0.3 • Java binary at: /Users/liewjuntung/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/203.7185775/Android Studio Preview.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6842174) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 12.4, Build version 12D4e • CocoaPods version 1.10.1 [✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome) ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable. [✓] Android Studio • Android Studio at /Users/liewjuntung/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/203.7185775/Android Studio Preview.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 11.0.8+10-b944.6842174) [✓] VS Code (version 1.54.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.20.0 [✓] Connected device (1 available) • USiPh11P1 (mobile) • 00008030-000579010C78802E • ios • iOS 14.2 ! Doctor found issues in 1 category. ```