jackocnr / intl-tel-input

A JavaScript plugin for entering and validating international telephone numbers. Now includes React and Vue components.
https://intl-tel-input.com
MIT License
7.57k stars 1.94k forks source link

Search Country enabled when separateDialCode = true #1758

Closed Korsario23 closed 1 week ago

Korsario23 commented 3 weeks ago

Plugin version

e.g. v24.3.3 (please try latest version)

Steps to reproduce

  1. Choose countrySearch: false,
  2. separateDialCode: true,

Expected behaviour

Country search textbox hidden

Actual behaviour

Country search textbox shows

Initialisation options

countrySearch: false, 
onlyCountries: ["mx","us","ca","cn","jp","fr", "de","gb", "es", "it", "ch", "nl", "ar","co","br","pe"],
countryOrder: ["mx","us","ca"],
initialCountry: "mx",
strictMode: true,
separateDialCode: true,
utilsScript: "https://cdn.jsdelivr.net/npm/intl-tel-input@24.3.3/build/js/utils.js?1724446080851"
Korsario23 commented 2 weeks ago

Other test, After you call iti.setNumber(mobileStr) textbox country search shows again...

jackocnr commented 2 weeks ago

Re: the main issue you raised - if you're using separateDialCode then I would strongly recommend leaving countrySearch enabled, as they work well together - see the readme on separateDialCode for more information.

Can I ask why you want to disable countrySearch? What is your use case? Why do you think that gives users a better experience?

With that said, I have just released v24.3.4 which now supports having separateDialCode=true and countrySearch=false if that's what you really want.

After you call iti.setNumber(mobileStr) textbox country search shows again...

What do you mean by "shows again"? I thought it was already showing and that was the problem?

Korsario23 commented 2 weeks ago

Hi, Thank you for your reply. Of course, I let you know this case. I enabled 3 countries (CAN, USA, MEX), so countrySearch is not convenient to show (as I think). But it is mandatory for my case to get the country code (separateDialCode).

I really, really appreciate and thank you for this release v24.3.4 :)

Korsario23 commented 2 weeks ago

I tried to support your work ($$$) but system declines my ccard. Any ideas ?

Screenshot 000196

jackocnr commented 2 weeks ago

I tried to support your work ($$$) but system declines my ccard. Any ideas ?

That's kind of you. You can also try my Paypal link if you like: https://paypal.me/jackoconnor

Korsario23 commented 2 weeks ago

Definitely I'm doing wrong. example 1 example 2

jackocnr commented 2 weeks ago

Have you definitely updated to the latest version?

You can play with this codepen to try it out.

Korsario23 commented 2 weeks ago

Yes, I did it. The problem was when you set value to the control, it re-initializes. Anyway, Than you very much. Excellent work!!!

jackocnr commented 2 weeks ago

The problem was when you set value to the control, it re-initializes

I don't understand this bit. Are you still seeing this problem? Can you explain in more detail? Can you provide more example code to reproduce the issue?

Are you using the JavaScript plugin, or the React component?

jackocnr commented 1 week ago

Closing due to inactivity.