-
Notifications
You must be signed in to change notification settings - Fork 14
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
Clearing the form field #16
Comments
It seems like the field does not listen correctly to the controller. When you try the opposite, setting a value through the controller, it also does not work. It will change the selected item in the drop down list, but it does not change the value displayed in the field. In other words, it is not possible right now to change the value through programmatic action. |
Sorry, I don't know if I understood fine. |
I have just tested that and it does indeed work (both with the clearing of the field, as well as setting it programmatically). However, it works when you put the element inside of a stateful widget and make the change in the controller in the setState method. That seems to me like a wrong thing to do. My expectation is that when I change the value in the controller, it automatically updates the input element (as it does in normal TextFields for example). In other words, I would prefer to see a solution where the select form field implements the listening to the controller and updating the state, in stead of me having to do that. But, having said that, it does work like this. |
How do you clear the select form field. I'm using a
TextEditingController
and callingclear
method to it doesn't clear the form fieldThe text was updated successfully, but these errors were encountered: