jackocnr / intl-tel-input

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

CountryOrder is not honoured after search terms removed. #1644

Closed NickSutton closed 4 months ago

NickSutton commented 4 months ago

Plugin version

v23.0.10

Steps to reproduce

  1. Search for a country by typing it's name
  2. Delete the search term.

Expected behaviour

I would expect countries listed in the countryOrder option to be first in the list.

Actual behaviour

The country list is in alphabetical order.

Initialisation options

separateDialCode: true,
strictMode: true,
initialCountry: 'ca',
countryOrder: ['ca'],
nationalMode: true,
utilsScript: "assets/InternationalTel_dev/build/js/utils.js",

I appear to be hitting this on initialisation;

TypeError: e[a] is not a function
    at intlTelInput.min.js:16:10141
    at Array.forEach (<anonymous>)
    at f (intlTelInput.min.js:16:10126)
    at intlTelInput.min.js:16:28769
NickSutton commented 4 months ago

Hadn't updated the import method for utils script.... Doh.