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
I noticed that using initialCountryCode for the CountryDropdown will cause onCountrySelected to trigger. I need a particular app behavior to respond only when onCountrySelected is triggered due to the user interaction, but I'm struggling to find a clean way to make the distinction.
Specifically, I want to move the focus to the next field in the form - the phone number text field - after the user selects the country. But since this triggers due to the initialCountryCode setting, my form is immediately focusing on the phone input, which is undesirable when the form is first loaded onto the screen.
If I could distinguish this somehow, that would solve my issues. Or, maybe you have thoughts on how better to integrate the CountryCode dropdown with the FocusNode conventions of Flutter and the conventions of Flutter forms?
The text was updated successfully, but these errors were encountered:
RobHoman
changed the title
Distinguishing onCountrySelected triggers for CountryDropdown (user choosing versus initial
Distinguishing onCountrySelected triggers for CountryDropdown (user choosing versus initialCountryCode triggering)
Mar 2, 2023
CountryDropdown is there as an example. You can easily take it as a base and write your own widget. But I think that's a good point and I'll add the way to distinguish user selection from the default one
I noticed that using
initialCountryCode
for theCountryDropdown
will causeonCountrySelected
to trigger. I need a particular app behavior to respond only whenonCountrySelected
is triggered due to the user interaction, but I'm struggling to find a clean way to make the distinction.Specifically, I want to move the focus to the next field in the form - the phone number text field - after the user selects the country. But since this triggers due to the
initialCountryCode
setting, my form is immediately focusing on the phone input, which is undesirable when the form is first loaded onto the screen.If I could distinguish this somehow, that would solve my issues. Or, maybe you have thoughts on how better to integrate the CountryCode dropdown with the FocusNode conventions of Flutter and the conventions of Flutter forms?
The text was updated successfully, but these errors were encountered: