Closed alexsanderp closed 10 months ago
This issue is stale because it has been open for 7 days with no activity. If there are no further updates, a team member will close the issue.
Any update? @agreaves @hariprasadms
Hi @alexsanderp, unfortunately this is how the TextField Mask in Flutter works. If you the value currently entered in the TextField does not match the mask, it removes the existing text. The fix is to make sure that the mask you use actually matches the text that is entered in the text field.
In general, I'd recommend using form validation or specifying the Keyboard type (e.g. only numbers, email keyboard, etc).
I believe that might not be the issue. When I have a number mask and try to edit a field by adding one more number at the end, the entire text gets deleted...
Has your issue been reported?
Current Behavior
I'm facing a problem that has left me a bit puzzled and I would greatly appreciate your help in resolving it. I'm working on a Flutter project and using TextField widgets with masks. The issue I'm encountering is that when I set an initial value for the field and try to edit it, all the characters get deleted, which is not the expected behavior.
Expected Behavior
Being able to edit text in a textfield with an initial value that has a mask.
Steps to Reproduce
Reproducible from Blank
Bug Report Code (Required)
ITFTlMmAx4VOodtb+KXtKcF4r2QXI0McX5Ir1utsewgjGKL1Bux/O87sXFpoXu2naVNcJFSLmngd/8LUhvDhK/QnAyqcQY861rpcFg3ke2iuMLawBc3pYHB5NJ5mIX6m57SRgiR+KtJpL1okwDvzIvK8VgXDFOu/Zwh9f6PHaOI=
Context
It affects the user experience as they have to rewrite everything every time they need to edit something
Visual documentation
Gravação de tela de 25-10-2023 18:54:37.webm
Additional Info
Doesn't happen with unmasked textfields
Environment