-
Notifications
You must be signed in to change notification settings - Fork 26.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Samsung Keyboard duplicates text when restoring composing regions (restart text input, punctuation) #31512
Samsung Keyboard duplicates text when restoring composing regions (restart text input, punctuation) #31512
Comments
Error on any application written flutter. Even on the base with one input field. |
Thanks for submitting this. I'm unable to reproduce it on a physical Pixel 2 right now. I think I have an S7 that I can try this on tomorrow. I'll post back with what happens. |
I'm testing on galaxy s8 and s9
Total: duplicates the entire word + letter |
The error is reproduced in Google Ad. Installed with play market |
Take any phone of the galaxy s8 or s9 family. Tested on two top Samsung s8/s9. |
Can you try this in a native app and confirm that you don't see this behavior? |
I use the standard firmware Samsung Galaxy S8 and Galaxy S9. We encountered this problem at the release stage of our flutter application |
Alright I see, thanks for clarifying. I tried again with the S6 but with the default keyboard in Russian and couldn't reproduce it still. I'll try to track down an S8 or S9. |
Russian keyboard not required. Create an app with a TextField:
So if you enter 'La', close, open, and press '!'. The TextField will read "LaLa!". This was tested on the dev (1.5.8) and stable (1.2.1) branch. Note: It is not reproducible on an Samsung S8. |
I found a Samsung T110 and couldn't reproduce it. Hope to try it on an S9 or T580 when I can. |
The above issue also reported this same problem on: Samsung Galaxy Tablet 8 A (Android 8.1). A bunch of good reproduction instructions there too. It seems like this definitely has to do with Samsung's predictive text. |
when to expect a solution to the problem? |
This is on my list of things I'd like to fix, though I still haven't come across a device that can reproduce it... If you or anyone else has some time to work on a PR to fix this in the meantime, please do! |
More testing per #33255 showed another interesting behavior @justinmc Wondering if this was looking at the last word, I tried another test case. Initial text
Hit Done, touch widget to edit it
Edit widget now shows: 'abc def ghighij' |
Flutter v1.5.4-hotfix.2, Stock Keyboard Initial Text value / removing all text to smaller caret size Potential related issue |
Help solve the problem! Our release is delayed because of this. Here is a similar problem #19743 |
To add another affected device to the list, this issue was seen in #19743 on a Galaxy Grand Prime with Android 5.1.1. |
I can't make promises, but I compiled the flutter engine and will attempt to diagnose and/or fix this. Below is more full logs of what I'm seeing with a debug build of the engine running my test scenario as detailed in #33255. I did a print statement for when the text edit controller receives the message that text has changed, so you'll see a "new text -> " log entry when the controller is called from my TextEdit. For this test, I did the following:
For sake of completeness, this issue seems to only affect Samsung devices and turning off Predictive Text on the device seems to avoid the issue. The test here was done against SM-T380, Samsung Galaxy Note 8A, Android 8.1.1 using the current Beta 1.6.3. Debug logs for anyone else so inclined and interested:
|
If you wanted to explore our android text input handling, you can take a look at shell/platform/android/io/flutter/plugin/editing/InputConnectionAdaptor.java and TextInputPlugin.java I could imaging the Samsung predictive text is using the android's text API/callbacks strangely or in an unintended way, causing us to misinterpret predicted words or parts of predicted words as additional input. Nonetheless, we should still find a way to support Samsung keyboards without negatively impacting other platforms. |
@exptk3 You are testing on stable channel, which does not have the fixes. Please try again on master channel ( I have verified it is fixed on the following test devices I have: S7 S9 S10 Note9 (same generation as s8), as well as on various tablets including Galaxy Tab A 2017 and 2018. I also have access to a bunch of pre-s7 devices that I have not recently tried, but those devices are quite old now and many of them did not repro the issue originally. |
I was able to reproduce the punctuation version of this bug on a J6+ that I dug up (SM J610G/DS). The hide keyboard version of this bug does not occur. |
Okay. *** Another Bug confirmed My test device is the Galaxy S8 as mentioned in the article above.
See the console log above. |
< Clean Project Test > The above is the result of testing with my Real World app. I wanted to see if there was any difference in the initial flutter app that I created, so I created a new project and tested it again, but the result is the same as the real app. It was reproduced as it is.
children: [
*** The problem is summarized below.
I hope this helps you solve various problems. |
@GaryQian In case it helps: the Samsung Experience Service version of the device we tested with is 10.6.00.13. The rest of the information you requested was already included in the flutter doctor I posted, but here it is again: device: Galaxy Tab A (2019, 10.1) |
Same problem here on master and a Galaxy Tab A (SM-T510) device.
|
For people looking for a quick workaround : replace Samsung Keyboard app by another Android Keyboard application ;-) |
Can confirm that all versions of this bug still occur on SM-T510 (Galaxy Tab A 2019 10.1") |
Update: Interestingly, the devices that are still reproing some variant of this bug are each doing something strange differently. For example, on SM-T510, the keyboard is sending a The duplication is also inconsistent on the J6+. |
@GaryQian Wow this seems like a complex issue! I always imagined that someone at Google on such a high profile project such as Flutter would be able to contact the Android and Samsung teams directly to get help with something like this. Not the case? |
Is this even allowed ? Unimplememted core functions ?? I cant think that flutter is the only one affected by this , right ?? |
Why does flutter even use the native keyboard?! 😏 |
@tedhenry100 We have been in contact with Samsung, however, this is one of those things where even if they fixed it on their end, we would still have to fix it here as it is unlikely all the keyboards in the wild can be updated. |
Since the original filing of this issue, the state of the bug has evolved. The severity has been greatly reduced for most devices, and new behaviors have been uncovered, evolving it towards a different set of issues. Since this can be difficult (and laggy) to follow in this thread of hundreds of comments, I will be moving further discussion to a new issue #51893 where we can focus on the current state of the issue. Please continue to contribute/report/comment on #51893 and reference comments in this thread as appropriate. Thanks! |
From the new thread: I have landed flutter/engine#17426 which seems to fix many of the bugs on my test devices. It would be great if others could confirm that this also fixes bugs for them. Please try the change on master channel! |
@GaryQian I've been testing this keyboard issue and I found a duplicate issue with the latest beta which flutter/engine#17391 is applied. |
Please do testing on master channel, I believe that bug has already been addressed in the other continuation thread via the getExtractedText() fix. Beta channel is often times over a month old, and many flutter bugs are fixed/updated on a daily basis. In particular, the getExtractedText() fix was only landed this week. |
@GaryQian I'm using the latest beta 1.17.dev.3.1. Is there any other updates regarding this other than flutter/engine#17391? I will let you know with the latest master commit. |
flutter/engine#17426 should resolve the duplication. |
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 |
Hello!
Within a flutter application that has TextField or TextFormField the text can get duplicated upon first time data entry.
When first entering a keypress, within a field that already has text pre-filled, the text duplicates then your keypress is attached.
I am experiencing something that exhibits this behavior on my Samsung Galaxy S7, S8 and S9 (only devices I have to test with). This doesn't occur within the emulator (Galaxy Nexus9 and Pixel 2).
If I place a space at the end of the field, this problem doesn't happen, however, if I tap in middle of a pre filled field (using controller or initialValue) and press a key it does occur.
https://stackoverflow.com/questions/52894507/flutter-texfield-and-textformfield-duplicates-text-when-using-initial-value-or-c
The text was updated successfully, but these errors were encountered: