catamphetamine / react-phone-number-input

React component for international phone number input
http://catamphetamine.gitlab.io/react-phone-number-input/
MIT License
915 stars 193 forks source link

Bug on `countryCallingCodeEditable` #408

Open jcfgt opened 2 years ago

jcfgt commented 2 years ago

Hello I found a bug on countryCallingCodeEditable() which cause a bug on Guadeloupe (yes, it is my test case).

It blocks the stroke.

Uncaught Error: Unknown country: undefined
    getCountryCallingCode metadata.js:631
    getInternationalPhoneNumberPrefix getInternationalPhoneNumberPrefix.js:5
    onPhoneDigitsChange phoneInputHelpers.js:410
    PhoneNumberInput_ PhoneInputWithCountry.js:139
    formatInputText inputControl.js:135
    onChange inputControl.js:35
    _onChange Input.js:44
    React 23
    js index.js:6
    Webpack 3
2 [metadata.js:631](webpack://react-lead-form/node_modules/libphonenumber-js/es6/metadata.js)
    getCountryCallingCode metadata.js:631
    getInternationalPhoneNumberPrefix getInternationalPhoneNumberPrefix.js:5
    onPhoneDigitsChange phoneInputHelpers.js:410
    PhoneNumberInput_ PhoneInputWithCountry.js:139
    formatInputText inputControl.js:135
    onChange inputControl.js:35
    _onChange Input.js:44
    React 15
    bind_applyFunctionN self-hosted:1313
    dispatchDiscreteEvent self-hosted:1276
    React 4
    forEach self-hosted:4290
    React 4
    js index.js:6
    Webpack

Capture d'écran Deepin_zone de sélection _20220624122557 Capture d'écran Deepin_zone de sélection _20220624122620 Capture d'écran Deepin_zone de sélection _20220624122717

catamphetamine commented 2 years ago

If you want, you can provide an online demo somewhere on codesandbox.io. The demo shouldn't use any "form libraries".