Dial code getting added to input when clearing leading "+" sign
manesid opened this issue · comments
Description:
When using countryCallingCodeEditable={false}
to prevent editing of the country calling code, attempting to clear the leading "+" sign still results in the code being added back to the input.
Steps to Reproduce:
- Set
countryCallingCodeEditable={false}
on the react-phone-number-input component. - Focus on the input field and move the cursor till + sign
- Try to clear the + sign using backspace
Expected Behavior:
- The country calling code should not get added to the input
Actual Behavior:
- The country calling code is unexpectedly inserted back into the input field.
Code
<PhoneInput
international
countryCallingCodeEditable={false}
defaultCountry="RU"
value={value}
onChange={setValue}/>
Additional Information
The issue can be reproduced on https://catamphetamine.gitlab.io/react-phone-number-input/ Force international format section's 2nd example
React-Phone-Number-Input.mp4
Published react-phone-number-input@3.3.10
with a fix.