-
Notifications
You must be signed in to change notification settings - Fork 86
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
ReactiveTextField is being cleared #412
Comments
Hi |
Hi @OVERENSAL, It sounds like you might have declared the FormGroup inside a Stateless Widget and each time the widget is destroyed and rebuilt you start with a fresh formGroup. There are 3 different approaches to avoid that: 2- Use a Stateful widget and declare your formGroup in the State. 3- Use the ReactiveFormBuilder (it is a Stateful widget by itself) |
Thank you for attention @joanpablo |
That's correct! If I enter a value from the keyboard, there are no issues. However, when I initialize the value using formGroup.control(CompanyFieldName.phone).value = phoneMaskFormatter.maskText('1123456789'), all the characters get cleared when I press the delete button on the keyboard or start editing the value. final phoneMaskFormatter = MaskTextInputFormatter( |
My problem has been solved:
|
When I insert a value into a text field like
form.control('some_control').value = 'some_text';
I click on the text field, start editing the value, then the entire field is cleared
What i can do to avoid this
The text was updated successfully, but these errors were encountered: