Comments (11)
If you're only allowing a single country, then why even let them open the dropdown? I would set allowDropdown
to false in this case.
from intl-tel-input.
I have these settings
"allowDropdown":false,
"autoPlaceholder":"off",
"dropdownContainer":null,
"formatOnDisplay":false,
"geoIpLookup":"ipapi",
"initialCountry":"ua",
"nationalMode":false,
"onlyCountries":["ua"],
"countryOrder":[],
"separateDialCode":true,
"useFullscreenPopup":false,
"strictMode":true,
"utilsScript":"utils.js"
from intl-tel-input.
Ok. And so does that solve your problem?
from intl-tel-input.
No
Here's a video https://watch.wave.video/kBRwJuGj7mFL1M2h
from intl-tel-input.
separateDialCode
requires the dropdown, so it forces allowDropdown
to be true
. If you want to have allowDropdown: false
, you'll need to set separateDialCode: false
.
from intl-tel-input.
If separateDialCode is set to false, then the country flag is moved to the other side of the field and the country code disappears.
https://watch.wave.video/EBlOELc5SwKfF1Ks
from intl-tel-input.
Yes, that is how allowDropdown=false works.
From the readme:
if showFlags is enabled we display the selected flag on the right instead because it is just a marker of state
from intl-tel-input.
I understand it.
Maybe then at least leave the country code where it was, otherwise it will be deleted...
from intl-tel-input.
otherwise it will be deleted
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.
from intl-tel-input.
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...
from intl-tel-input.
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
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 getNumber
, it will give you the full international number (including the international dial code). This is actually how the plugin is designed to work, which is why we show a national number placeholder by default, to encourage the user to do just this. Note that getNumber
requires the utils script to be loaded - see readme on how to load this.
The question is completely different - is a search field necessary if there is 1 country, or 2 countries, or 3 countries, etc.,
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.
from intl-tel-input.
Related Issues (20)
- This input doesn't work on two elements HOT 3
- Getting error while using utilsScript HOT 6
- React component - allow access to intlTelInput instance HOT 14
- [Webpack] Compilation warning when initializing `intlTelInput` with `utilsScript` HOT 3
- Ukrainian mobile code 98 conflicts with Iran code HOT 2
- Selecting any country with Country code +1 and adding number, it resets the country to US. HOT 1
- Brazilian numer is formating national code without parenthesis HOT 1
- In Version 23.0.7 the intlTelInput.getCountryData() static function returns empty string value for name property. It was working fine till v20.3.0 HOT 3
- UK phone numbers wrong validation rules HOT 1
- Migrate tests to Jest
- isValidNumber doesn't works properly for Brazilian numbers HOT 3
- Make input event on setNumber optional HOT 5
- CountryOrder is not honoured after search terms removed. HOT 1
- countryOrder not reinstated after a search HOT 3
- Default global icon for invalid dial code HOT 8
- setNumber cant be edited on a event listener
- Formatting does not return country to default HOT 3
- `separateDialCode=true` mode unexpected let user edit country code by typing in mobile HOT 2
- In God we trust, sending greetings from this side 🙏🏻💕
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from intl-tel-input.