-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
search field if one country? #1632
Comments
If you're only allowing a single country, then why even let them open the dropdown? I would set |
I have these settings "allowDropdown":false, |
Ok. And so does that solve your problem? |
No |
|
If separateDialCode is set to false, then the country flag is moved to the other side of the field and the country code disappears. |
Yes, that is how allowDropdown=false works. From the readme:
|
I understand it. |
Are you concerned that the user will type their international dial code, and then delete it? Why would they do that? Please can you describe the precise situation you're concerned about, breaking it down into simple steps, from when the plugin is first initialised, and the input is empty. |
When registering a user, if he does not enter the country code (no matter what country), it will not be possible to send an SMS message to the user. Because the SMS gateway requires the country code and the number itself. Not all users enter the country code themselves; most enter the phone number as usual (for example, 0971234567) and it is necessary that the country code already exists. The question is completely different - is a search field necessary if there is 1 country, or 2 countries, or 3 countries, etc., until how many countries are visible at once in the drop-down list? If they are already visible in the list and there is no need to search there, well, this is purely my opinion. And if there are more countries than are immediately visible in the open list, then the search field is already needed... |
This is actually incorrect. It's enough for the user to enter their number in national format (without the international dial code), and then if you use
Sure. Thanks for raising the question. For me, this is not something that should be decided by the plugin - it should be up to the dev to decide how they want this to work depending on their situation (e.g. it might depend on how many countries you can see at once in the dropdown etc, depending on their custom CSS), so this would require a new option to control it, and in my opinion, this is such an edge case that it's not worth implementing this right now. Especially in your case, where there is only 1 country, it doesn't make any sense to have a dropdown at all. |
Upon further consideration, if you only want to show say 2-10 countries, then it makes sense to allow the dropdown, but remove the search feature. So I propose we re-add the |
I've re-added the countrySearch option in v23.4.0 |
If you set only one country in onlyCountries, then why display the search field?
The text was updated successfully, but these errors were encountered: