Repository navigation
Korean characters are displayed abnormally in TextField when moved cursor. #29341
Copy link
Copy link
Closed
flutter-team-archive/engine
#12432Labels
a: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemscustomer: producte: device-specificOnly manifests on certain devicesOnly manifests on certain devicesframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.p: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagesplatform-androidAndroid applications specificallyAndroid applications specifically
Milestone
Description
Steps to reproduce
-
Input some Korean Characters into the TextField
안녕하세요| -
Move cursor to middle of characters
안녕|하세요 -
input some characters or numbers whatever
안녕5|하세요 -
boom
안녕하세요5|하세요
Check This
TextEditingController _textEditingController = TextEditingController();
return Container(
color: Colors.transparent,
padding: EdgeInsets.all(10.0),
child: Card(
color: Colors.transparent,
elevation: 8,
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(16.0)),
child: Container(
height: 50.0,
padding: EdgeInsets.symmetric(horizontal: 16.0),
color: Theme.of(context).accentColor,
child: TextField(
decoration: InputDecoration(icon: Icon(Icons.search), border: InputBorder.none, hintStyle: TextStyle(fontSize: 18), hintText: getHintText()),
textInputAction: TextInputAction.search,
cursorColor: Colors.black,
style: TextStyle(fontSize: 18),
controller: _textEditingController,
onSubmitted: (text) => handleSearch(context, searched_keyword, text, search_module_srl),
),
))),
);Logs
flutter analyze
There is no `flutter analyze` Error.
flutter doctor -v
[√] Flutter (Channel stable, v1.0.0, on Microsoft Windows [Version 10.0.17134.648], locale ko-KR)
• Flutter version 1.0.0 at C:\flutter
• Framework revision 5391447fae (3 months ago), 2018-11-29 19:41:26 -0800
• Engine revision 7375a0f414
• Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)
[√] Android toolchain - develop for Android devices (Android SDK 28.0.3)
• Android SDK at C:\Users\admin\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
• All Android licenses accepted.
[√] Android Studio (version 3.1)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 29.0.1
• Dart plugin version 173.4700
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
[!] VS Code, 64-bit edition (version 1.27.2)
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension not installed; install from
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[√] Connected device (1 available)
• SM G973N • R39M20E00AJ • android-arm64 • Android 9 (API 28)
! Doctor found issues in 1 category.
This problem only occurs on Android only .. iOS was fine.
Reactions are currently unavailable
Metadata
Metadata
Labels
a: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemscustomer: producte: device-specificOnly manifests on certain devicesOnly manifests on certain devicesframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.p: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagesplatform-androidAndroid applications specificallyAndroid applications specifically
Activity
HansMuller commentedon Jun 21, 2019
cc @GaryQian
timsneath commentedon Sep 3, 2019
I am not myself able to reproduce this on the latest Flutter master:

Could you try upgrading with
flutter upgradeand try again on a more recent build? This may have been fixed since it was reported...My minimal repro attempt is here: https://gist.github.com/timsneath/284c320678435bd29ae6e7f7aa73d1ce
timsneath commentedon Sep 5, 2019
This bug reproduces on a Samsung Galaxy 9 with the Samsung keyboard, running v1.7.8 from the
stablechannel. It may have the same cause as #31512. It does not reproduce with the Gboard keyboard. The bug is blocking a Korean company from shipping a flagship Flutter app, and so they are seeking a fix urgently.17 remaining items
justinmc commentedon Sep 20, 2019
I filed a bug on Android as I continue to investigate this: https://b.corp.google.com/issues/141367011
justinmc commentedon Sep 23, 2019
I'm making some progress but not quite there yet. @mklim came up with a fix that worked on native Android, but it didn't work when I tried copying it into Flutter. I found that when I extended BaseInputConnection like Flutter does, then the solution didn't work in native Android either. My conclusion is that Flutter's BaseInputConnection subclass is somehow causing this problem.
I found that I can make native Android work by adding these three methods from BaseInputClass to the subclass:
As pointed out in the comments in the code block, there are three vital calls here that are not able to be made in Flutter due to Flutter not having an instance of TextView. Removing any of these causes the solution to not work.
From here, maybe I can look into the source code of these three calls and see if I can figure out what exactly is making this work, and if we can somehow do the same in Flutter.
mklim commentedon Sep 24, 2019
I have one potential workaround up at mklim/engine@1134c9e7c557586d0a21a1b758c480532cbd12db. It still needs tests before I open it as a PR but I think the basic approach will unblock this. It's extremely heavy handed, but I think it is feasible. I'm restarting the IMM instead of
finishComposingText(). From what I could tell since we're usingupdateSelectionwe need a full restart.Kiboom commentedon Sep 25, 2019
We’re building a Q&A service using Flutter, which contains TextFields for the question.
Users tend to type lengthy text on it, so there's a high chance that they move cursor and insert some characters.
But like it's been discussed in the thread, the same issue reproduces in our TextFields on Samsung devices with Samsung Keyboard.
Since writing action is the key feature of our app, it's very critical issue that blocks us from shipping our flagship app.
It's a good to know that potential workaround has been found, though :)
Due to the time-sensitive schedule, we hope this issue can be resolved with a higher priority.
Thanks
Work around Samsung keyboard issue (#12432)
mklim commentedon Sep 25, 2019
The work around has landed in the engine, but it will still take some time for it to roll into the framework and then the beta, dev, and finally stable channels.
ETA: This rolled into flutter master at bcbe822.
markmoskalenko commentedon Sep 26, 2019
Included in the assembly of the Russian language!
Similar problem !!!!
chulwoo-park commentedon Nov 25, 2019
This issue is still occurs when using the korean qwerty keyboard.
We tested on beta channel(1.11.0).
steps:
가나.12.가, then:GaryQian commentedon Nov 26, 2019
Thanks for the additional repro! The fix we landed was a workaround, and it doesn't seem to cover this case.
timsneath commentedon Nov 27, 2019
github-actions commentedon Aug 25, 2021
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.Work around Samsung keyboard issue (flutter-team-archive/engine#12432)