You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Flutter Desktop] Textfield does not accept accents #75510
On the desktop when I try to insert a letter with accents it looks as if I had pressed the button 2 times.
Ex:
~ + a = ã
~~ = ~~
But what is happening is: ~ + a = ~~ a
What happens:
What should happen:
Code example:
TextField(
controller: TextEditingController())
Flutter Doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel dev, 1.26.0-17.2.pre, on Microsoft Windows [versão 10.0.19042.746], locale pt-BR)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.8.3)
[√] Android Studio (version 4.1.0)
[√] VS Code (version 1.52.1)
[√] Connected device (3 available)
• No issues found!
Edit:
Im using logitech k380 (en_US format) and typing pt_BR, I tried do this with virtual keyboard and works well. Probably the problem is because the keyboard is in the en_US standard and my pc is set to type pt_BR.
An alternative solution until this is fixed, is to put in onChanged to identify ~~a or ^^e etc. And replace text in the controller with the correct one, ex:
@Bestfastfire thanks for filing! Would you mind adding detailed repro steps for this? Specifically, which keyboard/language settings are you using? Looks like your input method/keyboard are configured with ~ and ^ as dead keys, and then you type ~a or ^e to get ã and ê respectively?
@Bestfastfire thanks for filing! Would you mind adding detailed repro steps for this? Specifically, which keyboard/language settings are you using? Looks like your input method/keyboard are configured with ~ and ^ as dead keys, and then you type ~a or ^e to get ã and ê respectively?
@Bestfastfire thanks for filing! Would you mind adding detailed repro steps for this? Specifically, which keyboard/language settings are you using? Looks like your input method/keyboard are configured with ~ and ^ as dead keys, and then you type ~a or ^e to get ã and ê respectively?
I tried with virtual keyboard and works well. Now that you mention it, I think the problem may be due to alternative keyboards since the k380 is in the en_US format and I'm trying to pt_BR.
Thanks! Can you confirm whether this started recently or whether it's always been an issue for you? There have been two major Windows keyboard input related changes recently: one that deals with individual key events, another that adds support for CJK input via IMEs, either of which I could imagine impacting multi-key character input.
Thanks! Can you confirm whether this started recently or whether it's always been an issue for you? There have been two major Windows keyboard input related changes recently: one that deals with individual key events, another that adds support for CJK input via IMEs, either of which I could imagine impacting multi-key character input.
Sorry, I didn't notice before, I just noticed it today.
So far nothing, I am using the latest stable version of the flutter the bug continues, but it is only on this specific keyboard that I reported, it is in the EN_US standard and on windows it is set to PT_BR.
I tested it on a keyboard that is PT_BR and it worked normally
So far nothing, I am using the latest stable version of the flutter the bug continues, but it is only on this specific keyboard that I reported, it is in the EN_US standard and on windows it is set to PT_BR.
I tested it on a keyboard that is PT_BR and it worked normally
Interesting, my keyboard is PT_BR (brazilian laptop) and it doesn't work. I have exactly the problem you mentioned early.
Reacted by Pablo Henrique, Pedro Carvalho, Eduardo Marques and MarssalSquadra
So far nothing, I am using the latest stable version of the flutter the bug continues, but it is only on this specific keyboard that I reported, it is in the EN_US standard and on windows it is set to PT_BR.
I tested it on a keyboard that is PT_BR and it worked normally
Interesting, my keyboard is PT_BR (brazilian laptop) and it doesn't work. I have exactly the problem the you mentioned early.
If anyone needs an urgent fix to release (since the bug has been around for a long time and an official fix hasn't been released yet), I've made this ugly fix so it can work. I created a custom input and replaced it with the default one, then added that to my onChange.
if (UtilsPlatform.isWindows) {
int pos = controller.selection.start;
String newValue = value
// A
.replaceAll('´´a', 'á')
.replaceAll('``a', 'à')
.replaceAll('^^a', 'â')
.replaceAll('~~a', 'ã')
.replaceAll('´´A', 'Á')
.replaceAll('``A', 'À')
.replaceAll('^^A', 'Â')
.replaceAll('~~A', 'Ã')
// E
.replaceAll('´´e', 'é')
.replaceAll('``e', 'è')
.replaceAll('^^e', 'ê')
.replaceAll('´´E', 'É')
.replaceAll('``E', 'È')
.replaceAll('^^E', 'Ê')
// I
.replaceAll('´´i', 'í')
.replaceAll('``i', 'ì')
.replaceAll('^^i', 'î')
.replaceAll('´´I', 'Í')
.replaceAll('``I', 'Ì')
.replaceAll('^^I', 'î')
// O
.replaceAll('´´o', 'ó')
.replaceAll('``o', 'ò')
.replaceAll('^^o', 'ô')
.replaceAll('~~o', 'õ')
.replaceAll('´´O', 'Ó')
.replaceAll('``O', 'Ò')
.replaceAll('^^O', 'Ô')
.replaceAll('~~O', 'Õ')
// U
.replaceAll('´´u', 'ú')
.replaceAll('``u', 'ù')
.replaceAll('^^u', 'û')
.replaceAll('´´U', 'Ú')
.replaceAll('``U', 'Ù')
.replaceAll('^^U', 'Û');
/// Makes the cursor stay in the correct place
pos -= (value.length - newValue.length);
if (pos > newValue.length) {
pos = newValue.length;
}
controller.selection =
TextSelection.fromPosition(TextPosition(offset: pos));
onChanged(newValue);
} else {
onChanged(value);
}
It's not the best solution, and I haven't checked every possible character with accents, but it works fine for me.
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 -v and a minimal reproduction of the issue.
Activity
Bestfastfire commentedon Feb 5, 2021
An alternative solution until this is fixed, is to put in
onChangedto identify ~~a or ^^e etc. And replace text in the controller with the correct one, ex:With regex I will make a better solution than comparing with all possible accents.
HansMuller commentedon Feb 5, 2021
CC @cbracken
cbracken commentedon Feb 5, 2021
/cc @gspencergoog too
cbracken commentedon Feb 5, 2021
@Bestfastfire thanks for filing! Would you mind adding detailed repro steps for this? Specifically, which keyboard/language settings are you using? Looks like your input method/keyboard are configured with
~and^as dead keys, and then you type~aor^eto get ã and ê respectively?Bestfastfire commentedon Feb 5, 2021
Im using logitech k380 with lang pt_BR
Bestfastfire commentedon Feb 5, 2021
I tried with virtual keyboard and works well. Now that you mention it, I think the problem may be due to alternative keyboards since the k380 is in the en_US format and I'm trying to pt_BR.
cbracken commentedon Feb 5, 2021
Thanks! Can you confirm whether this started recently or whether it's always been an issue for you? There have been two major Windows keyboard input related changes recently: one that deals with individual key events, another that adds support for CJK input via IMEs, either of which I could imagine impacting multi-key character input.
Bestfastfire commentedon Feb 5, 2021
Sorry, I didn't notice before, I just noticed it today.
cbracken commentedon Feb 5, 2021
No problem -- thanks for filing the issue. Will take a look!
5 remaining items
ReniDelonzek commentedon Apr 19, 2021
I have the same problem, it was introduced in the last beta version (2.1.0-12.2.pre), the problem only occurs on windows, on MACOS it works correctly
eduardo-cervantes commentedon Apr 20, 2021
Any predictions for solving this problem, or do you have any workarounds?
alberteije commentedon Apr 23, 2021
It seems there is no solution for now?
Bestfastfire commentedon Apr 24, 2021
So far nothing, I am using the latest stable version of the flutter the bug continues, but it is only on this specific keyboard that I reported, it is in the EN_US standard and on windows it is set to PT_BR.
I tested it on a keyboard that is PT_BR and it worked normally
alberteije commentedon Apr 24, 2021
Interesting, my keyboard is PT_BR (brazilian laptop) and it doesn't work. I have exactly the problem you mentioned early.
pablohls commentedon Apr 24, 2021
The same for me.
alycwb commentedon Jun 15, 2021
I have an entire application developed, but I can't release it to production because of this issue. Any ETA to fix this bug?
ReniDelonzek commentedon Jun 16, 2021
If anyone needs an urgent fix to release (since the bug has been around for a long time and an official fix hasn't been released yet), I've made this ugly fix so it can work. I created a custom input and replaced it with the default one, then added that to my onChange.
It's not the best solution, and I haven't checked every possible character with accents, but it works fine for me.
alycwb commentedon Jun 16, 2021
Tks ReniDelonzek, I will try that!
SalahAdDin commentedon Jun 17, 2021
I'm having this bug with mobile applications.
marcoprodata commentedon Jul 22, 2021
Any news about this bug?
nero-angela commentedon Jul 24, 2021
mobile also has this issue. #59541
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.