YieldStudio / nova-phone-field

Nova Phone Number field with a dynamic mask based on the country code inserted by the user.
Other
6 stars 4 forks source link

Field is always adding a + to the front of the number #10

Open wesgood opened 3 months ago

wesgood commented 3 months ago

Thank you for putting together this helpful Nova tool.

My project allows users to save phone numbers in the full 10 digit format of Canada and USA along with the 5 and 6 digit numbers for helplines and custom services. I was able to support both by using the helpful custom format tool.

->withCustomFormats('#####', '######')

I have run into a problem where saving the 5 and 6 digit numbers always inserts a + character at the beginning of the number. When the resource is edited in the future, this character is detected as a full 10 digit number and the format breaks. I would like to prevent the + character from being added to the custom formats.

Possible solutions