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
TextField: "autocorrect: false" still shows suggestions in keyboard #22828
Comments
After further investigation, I'm not sure what would be the best way to implement this: On iOS, autocorrect and keyboard suggestions are directly connected ( On Android, autocorrect and keyboard suggestions can be toggled separately.
Here is how the flags are currently set by flutter: So for Android it would make sense to add a new property |
I have the same problem implementing a textfield without the suggestion bar on android. For my app the user can input specific codes that should not be changed with suggestions or autocomplete. The suggestion bar is really not helpful in this situation and I can't disable it on android. Any idea on when the feature to disable the suggestion bar on android will be implemented? |
This technically sounds like pretty "low hanging fruit" for the Flutter dev team (but I might be wrong), but the fact that it is not possible to disable the suggestions in a Flutter app is extremely annoying for app developers. |
Any update on this... I am having the same problem. Love Flutter! |
Any update on this? This is fixed locally for me by turning off predictive text... can't expect that of users.... |
I've looked into this and it seems that the
Why this is the case may be the root of the problem. |
Are we positive that this is a real regression? Is it possible that @sir-boformer is testing this on a device that doesn't respect the flag? |
@dnfield agreed, this is not a regression. I did the initial implementation on Android and iOS and the difference would have been an oversight on my part. As suggested above, I think the answer is that we add additional API and document the platform differences between iOS and Android. |
Help solve the problem! Our release is delayed because of this. Here is a similar problem #19743 |
Hey @markmoskalenko , I see the issue you are referencing and I experienced something similar. The issue was if I selected a text field that had text in it and started typing the text would duplicate and add the character typed. Ex: You have the word fire in the text field Now it has firefiret in it. Now that looked similar to issue 19743 so if this is also bothering you, I can help you fix it as I implemented a workaround in my app. |
Very worried! |
I went ahead and commented on issue #19743 on how to solve this. |
Temporary solution |
This is a bug. Assuming earlier comments have identified the correct source code, InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS is only being added when obscureText is true, not when autocorrect is false I've verified on my Pixel 3 that setting obscureText = true does disable keyboard suggestions, whereas setting autocorrect = false does not. |
Nice catch. This works for me too but obscureText have several negative effects in my case (using a Huawei Mate 20 Pro with Android 9 and Swiftkey keyboard):
Is anyone working on a bug fix/PR for the Inputype flag? |
I am experiencing the same issue also on ios - |
You can set obscureText=true but that have some negative effects as stated above. But I agree - is there any progress on this issue? |
I just opened two PRs for this: #42550 and flutter/engine#13099 I'm pretty much following exactly what @sir-boformer wrote in his analysis above (thank you for that by the way!). I added a flag that only affects Android called
|
How cannot find the option to disable suggestions. What am I missing? Why is this closed? |
Hi @RudolfVonKrugstein, what version of Flutter are you using? |
Hi @Piinks, I'm having the same problem. Am I doing something wrong? I am on the very latest master branch (v1.12.17-pre.38) but I'm getting the following result (ie suggestions) with the following code
|
cc/ @justinmc who worked on the fix for this. I haven't reproduced it yet on master. |
@atreeon @RudolfVonKrugstein Try with this
|
Hi @MichalOlechowskiDev, that does indeed work. I would say that it isn't so obvious and also enableSuggestions doesn't seem to alter the behaviour at all (just the keyboardType property) and this doesn't work when the keyboardType is set to anything else other than visiblePassword. The result is what I am after though so thank you! |
Thanks, this helps. I think that setting any form om password input type will prevent swiping functionality on keyboards that supports it, e.g. stock android and swiftkey. Not sure though and I haven't tested it. I was expecting it to work like this:
If that is correct I would like to set a non password type of keyboard, enable autocorrect and disable suggestions. |
Gboard ignores the TYPE_TEXT_FLAG_NO_SUGGESTIONS flag in some situations (see this StackOverflow post), which is what is controlled by the We want to provide a nice platform-independent API and not just create a parameter for every native flag, but we also might not want to special-case things for Gboard in the engine. I'm not sure if there's a clear improvement to be made here, but I'm definitely interested if someone has a proposal. |
In this case, is better reopen the issue? |
This still doesn't do what I want. As noted above, the enableSuggestions flag appears to do nothing by itself. Only when paired with keyboardType: TextInputType.visiblePassword do the suggestions go away. However, now other options, such as textCapitalization: TextCapitalization.words are ignored. These are my main requirements - no suggestions (preferably without any space wasting empty grey box or numbers which appear with visiblePassword), and capitalized words. Is there anyway to achieve this currently in flutter? |
@kevinengel Can you achieve that in native Android, and if so what flags do you use? |
Good point, same issue does occurs with Android, please ignore my last post. Guess it's just a keyboard issue (though c'mon Pixel 3, I feel like you of all phones should be supporting all the Android features ...) |
Gboard definitely seems to be doing some non-intuitive things based on the flags that are given. |
Any chance on reopening this issue? I'm having this issue on Huawei mate and setting I don't want user to use autocomplete because they might enter non-word texts. |
@cihadturhan you would have better luck filing a specific issue for Huawei devices with reproduction instructions. |
May 2020, flutter stable 1.17.1, still experimenting this issue with default samsung's keyboard (S8) and with this code :
PLEASE RE OPEN |
@louia Can you achieve what you want with a native Android app? If so, how? See #22828 (comment) If you can reproduce a case that is possible in native Android but not possible in Flutter given the flags being set, go ahead and open a separate issue with reproduction steps. Please tag me and I'll be interested to see what's going on. |
That's work on Flutter 1.20.2, iOS device. |
I am facing the same issue, Ios work just fine using : But in an android device I still have the suggestions. In Android natif you can get this using : @louia do you want me to open a new issue ? |
@nicolasfavier I say yes, please open a new issue with this info! Someone can double check whether or not those exact inputType flags you mentioned are being set by the Flutter engine. |
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 version: Very recent master build
Happens in the Android Emulator (with Google Keyboard) and on a real Android device (with Sony keyboard). I'm not sure about iOS.
Code to reproduce:
The text was updated successfully, but these errors were encountered: