twenty
twenty copied to clipboard
Adding US number isn't possible in UI
Ticket: https://discord.com/channels/1130383047699738754/1435333433084608675
Scenario:
- Log in
- Go to People table view
- Try adding another phone number (+1 555 987 6543) to any record
Actual: It's not possible to add US number in UI
https://github.com/user-attachments/assets/817606fa-de64-4772-8923-ca931cc97eb5
Expected: It's possible to add US number in UI
Note: It's possible to do it via API
Hey 👋, I’d love to work on this issue!
Could you please confirm if it’s open for community contribution?
If yes, I can start investigating the UI phone validation logic and open a PR.
@Infinimus01 feel free to open PR
Hey @BOHEUS, I am also looking into this issue
Hey @BOHEUS
Resolution
After investigation, the phone number validation is working correctly as intended. The issue was a misunderstanding about valid US phone number formats rather than a bug in the validation logic.
Root Cause
The number being tested (+1 555 123 4567) was being correctly rejected because 555 is not a valid US area code.
In North American phone numbers, the format is: +1 [Area Code] [Exchange] [Subscriber]
+1 555 123 4567has 555 as the area code (first 3 digits) ❌ Invalid+1 415 555 1234has 415 as the area code and 555 as the exchange (middle 3 digits) ✅ Valid
The confusion stems from 555 being commonly used in movies/TV for fictional numbers, but it's valid only as an exchange code (middle digits), not as an area code (first digits).
Testing
The validation correctly accepts valid US numbers such as:
+1 415 555 1234(San Francisco area)+1 212 555 1234(New York area)+1 202 555 1234(Washington DC area)
And correctly rejects invalid numbers like:
+1 555 123 4567(invalid area code)
The libphonenumber-js library is properly validating against the official North American Numbering Plan. No code changes were needed.