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
TextField with maxLength needs multiple delete taps to delete text #67828
Add maxLength: 5 to the TextField widget and try entering: "123456789" to the text field. You will need to press backspace 5 times to start deleting the text. My hunch is that we are not storing the inner "cursor position" correctly. The data seems to be correct (pressing the FAB always returns 12345).
I recall this used to work so marking as regression.
and i enter 123456abc , the text shows 123456 , but i need to delete 3 times (abc) before i'm able to delete the numbers. Is this the intended behaviour? even using a custom TextInputFormatter to never change the text it stills preserves a "history".
The issue seems to be fixed once i remove the focus of the textfield and focus it again. Then it seems that internally 123456abc becomes 123456
-flutter doctor
[√] Flutter (Channel beta, 1.22.1, on Microsoft Windows [Versión 10.0.18362.239], locale es-ES)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[√] Android Studio (version 4.0)
[!] IntelliJ IDEA Community Edition (version 2018.2)
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
[√] VS Code (version 1.49.0)
[√] Connected device (1 available)
I noticed this issue today too, I'm using inputFormatters with digits only filter along with the max length of 6. It seems like there is a counter or something internally which means even if I limit my input to 6 characters, each additional character will not appear in the input field, but it will be counted and will disrupt backspace functionality (nothing gets deleted until you reach the "real" input text).
Let's hope this will be fixed ASAP as it is a pretty severe bug for such a widely used functionality.
Flutter doctor
[√] Flutter (Channel stable, 1.22.0, on Microsoft Windows [Version 10.0.18363.778],
locale en-GB)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[√] Android Studio (version 3.6)
[√] VS Code (version 1.49.3)
[√] Connected device (1 available)
• No issues found!
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
elMuso commentedon Oct 10, 2020
The same happens when using FilteringTextInputFormatter, i use
and i enter 123456abc , the text shows 123456 , but i need to delete 3 times (abc) before i'm able to delete the numbers. Is this the intended behaviour? even using a custom TextInputFormatter to never change the text it stills preserves a "history".
The issue seems to be fixed once i remove the focus of the textfield and focus it again. Then it seems that internally 123456abc becomes 123456
-flutter doctor
lstimac commentedon Oct 10, 2020
I noticed this issue today too, I'm using inputFormatters with digits only filter along with the max length of 6. It seems like there is a counter or something internally which means even if I limit my input to 6 characters, each additional character will not appear in the input field, but it will be counted and will disrupt backspace functionality (nothing gets deleted until you reach the "real" input text).
Let's hope this will be fixed ASAP as it is a pretty severe bug for such a widely used functionality.
Flutter doctor
pedromassango commentedon Oct 11, 2020
Duplicate of #67236
xu-baolin commentedon Oct 12, 2020
I am posting the fix PR now.
github-actions commentedon Aug 10, 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.