There is no way to fully clear the input
I made the phone number field optional in my project. But is there a way to fully clear the input after starting entering the phone number? Because I can't remove the country code if it was already selected.
You can remove the country code, but you can't remove the prefix. The functionality to hide prefix (default behavior without alternative option) if input is clear would be good to see. But to change default behavior of guessed country flag that is attached to empty input is not desirable. You may want to add the possibility to pass -1 as the country value, and if the condition is met (digits not present in the input value), clear country flag by passing -1 as the country value in the callback.
Same issue, in my project phone field is optional as well but the inputs field is having a default value + as a prefix. Still looking for a way to clear the input.

If you pass null as value, the country will be cleared.
If you pass empty string, country will not be cleared.
Same issue, in my project phone field is optional as well but the inputs field is having a default value + as a prefix. Still looking for a way to clear the input.
@azmatrana Were you able to find any solution to this? I do Command + a and then Backspace, it leaves a +. It's not clearing the entire input.
@praneethEnphase I tried the ff and it clears the plus sign in the input:
onChange={(val, data, e, fmtVal) => {
onChange(fmtVal === '' || fmtVal === '+' ? null : fmtVal);
}}
The inner onChange function is just a passed handler. The outer onChange function is the one needed for this library.