material-ui-phone-number icon indicating copy to clipboard operation
material-ui-phone-number copied to clipboard

Ability to clear the input (remove +)

Open david-vendel opened this issue 4 years ago • 6 comments

Hello, I have phone number as not-required input. I am forced to have defaultCountry prop, as without it component is crashing. But I want user, after playing with this field, to be able to remove the phone number and leave empty. To know that he is saving form without phone number. I am unable to remove leading +.

Is there possibility to fix this? Thank you.

david-vendel avatar Oct 13 '21 21:10 david-vendel

I would also like to know how to do this because at the moment its saving as + or +44 for example in the database. I can't figure out a way of allowing the user to have an empty value.

LukeHardyLexacom avatar Nov 24 '21 11:11 LukeHardyLexacom

Is there any update on this? Similar issue as this field being not required.

Abhishek-VG avatar Dec 13 '21 11:12 Abhishek-VG

I still have not heard anything and this is really an annoying issue. Any news?

LukeHardyLexacom avatar Dec 22 '21 08:12 LukeHardyLexacom

I am using hack by adding few conditions in onChange function by removing plus icon when field is cleared. That's the only option till we get a fix

Abhishek-VG avatar Dec 23 '21 15:12 Abhishek-VG

I am using hack by adding few conditions in onChange function by removing plus icon when field is cleared. That's the only option till we get a fix

Can you share us your code to see your hack?

LukeHardyLexacom avatar Jan 10 '22 09:01 LukeHardyLexacom

Same problem for us. Hope this gets fixed.

danielkochengineer avatar Feb 02 '23 12:02 danielkochengineer