Skip to content
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

Add the ability to disable the country list dropdown #82

Closed
kishimisu opened this issue Jul 3, 2021 · 1 comment
Closed

Add the ability to disable the country list dropdown #82

kishimisu opened this issue Jul 3, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@kishimisu
Copy link

It could be great to have a similar property to readOnly or enabled for the country list dropdown.
I need the user to enter its phone number, and once validated I need to keep the IntlPhoneField widget but without the ability to change it. So I disable the textfield, but I can't disable the country list drop down, even if I hide the cursor icon using showDropdownIcon=false.

As a quick fix I tried to change the countries array after validating the phone number and set it to one unique value (the currently selected country) so even if the user access the dropdown he won't have the ability to change the country.
Unfortunately, this doesn't seems to work as the initial value of countries seems to be permanent, even when updating it in a stateful widget.

@marcaureln marcaureln added the enhancement New feature or request label Jul 7, 2021
@marcaureln
Copy link
Collaborator

Thanks for your feedback, there is no doubt that when set to false, enabled must deactivate the dropdown button as well. I'd just implemented it (see f9fc8ca). You'll be able to do it in the next release of the package or if you need to use this feature now, you can see how to do it here. Until next time, enjoy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants