Giter VIP home page Giter VIP logo

Comments (11)

jackocnr avatar jackocnr commented on June 17, 2024

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.

Morbids avatar Morbids commented on June 17, 2024

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.

jackocnr avatar jackocnr commented on June 17, 2024

Ok. And so does that solve your problem?

from intl-tel-input.

Morbids avatar Morbids commented on June 17, 2024

No
Here's a video https://watch.wave.video/kBRwJuGj7mFL1M2h

from intl-tel-input.

jackocnr avatar jackocnr commented on June 17, 2024

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.

Morbids avatar Morbids commented on June 17, 2024

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.

jackocnr avatar jackocnr commented on June 17, 2024

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.

Morbids avatar Morbids commented on June 17, 2024

I understand it.
Maybe then at least leave the country code where it was, otherwise it will be deleted...

from intl-tel-input.

jackocnr avatar jackocnr commented on June 17, 2024

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.

Morbids avatar Morbids commented on June 17, 2024

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.

jackocnr avatar jackocnr commented on June 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.