cedvdb / phone_form_field

Flutter phone number input
https://pub.dev/packages/phone_form_field
MIT License
70 stars 98 forks source link

Option to exclude country selector chip from focus #223

Closed hbatalhaStch closed 7 months ago

hbatalhaStch commented 7 months ago

Gives a better UX on mobile forms whose fields have textInputAction: TextInputAction.next if the country selector chip is excluded from focus. This PR add the property skipFocusOnCountryNavigator(which defaults to false) to the PhoneFormField to control that.

cedvdb commented 7 months ago

Could you explain the scenarios where we would want it to be focusable vs not focusable ? Is making it never focusable an acceptable option ?

hbatalhaStch commented 7 months ago

In the gif below we have a situation where it is not focusable, as you can you see, you click the keyboard next button and the next field gain focus. And that happens after you finish writing the email and click next, you will immediately be prompted to enter the phone number and in a smooth way. notFocused

In the gif below we have a situation where it is focusable, after you finish writing the email and click next, the keyboard will go down because the focus goes to the navigator chip which you can do nothing when you are on mobile and you would have to go and click on the phone field to enter the number to proceed, which in my opinion is not a good ux because it breaks the pattern the user was on up until then. focused

cedvdb commented 7 months ago

Let's make it unfoccussable always without giving the option to change it. This is to not add unnecessary parameters that make it to the public API.

hbatalhaStch commented 7 months ago

Let's make it unfoccussable always without giving the option to change it. This is to not add unnecessary parameters that make it to the public API.

Done