material-ui-phone-number
material-ui-phone-number copied to clipboard
Crashes the app if field left empty
If the user tries to delete the entire phone number, it stays only '+' which is annoying. More problematic, if he try to exit the form, the app crashes with this error:
index.js:2526 Uncaught TypeError: Cannot read property 'dialCode' of undefined
at e.updateDefaultCountry (index.js:2526)
at e.value (index.js:2945)
Here is my code
<MuiPhoneNumber className={classes.phoneInput} style={{ width: formInputWidth }} defaultCountry={defaultCountryCode} disableAreaCodes={true} placeholder="Mobile number" value={props.phone} onChange={onChangePhone} label={'Mobile'} error={props.tfa && !props.phone} helperText={props.tfa && !props.phone ? t('validation.requiredField') : ''} required={props.tfa} localization={localization} />