Closed robbileifss closed 3 years ago
@catamphetamine any idea if this is the framework or just my code?
@robbileifss Hi. Yeah, I haven't looked into the issue yet. I can look at it some time later, but not anytime soon. Maybe in a month or two.
@robbileifss I was seeing the same issue.
This is what my code looked like:
<PhoneInput value={value == null ? "" : `${value.rawInput}`} .......
The fix for me was to instead of setting value to an empty string, set it to "undefined"
:
<PhoneInput value={value == null ? "undefined" : `${value.rawInput}`} ......
I'll add this note in the README since people are periodically expecting it to handle empty strings.
Note: Don't pass an empty string
value
, passundefined
instead. Same's true for thevalue
argument ofonChange
— whenvalue
is empty, it isundefined
, not an empty string.
Hi,
I have an issue, maybe it's something I've missed or wrongly setup. But I can't find out. When going back in my application to the page where I selected the country from the phoneinput control. Wanting to change the country, I have to select it twice in order for it to stick. See the attached gif.