bl00mber / react-phone-input-2

:telephone_receiver: Highly customizable phone input component with auto formatting

Home Page:https://bl00mber.github.io/react-phone-input-2.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Country prefix missing when value set to empty string

Criezc opened this issue · comments

Hi, currently I'm using your libraries as phone number input. But I encountered an issues where if I click the reset button which resetting the value of sender into an empty string. It forces the country prefix (+62) into null. Only leaving the flag it self

this is my code

<InputPhone
                        label="Sender Number"
                        value={sender}
                        onChange={setSender}
                        country="id"
                        onlyCountries={['id']}
                      />

for the examples after I set my sender state into empty string

image

issues resolved by setting setState into ('+62')