twenty icon indicating copy to clipboard operation
twenty copied to clipboard

Adding US number isn't possible in UI

Open BOHEUS opened this issue 1 month ago • 4 comments

Ticket: https://discord.com/channels/1130383047699738754/1435333433084608675

Scenario:

  1. Log in
  2. Go to People table view
  3. 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

BOHEUS avatar Nov 06 '25 13:11 BOHEUS

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 avatar Nov 06 '25 15:11 Infinimus01

@Infinimus01 feel free to open PR

BOHEUS avatar Nov 06 '25 16:11 BOHEUS

Hey @BOHEUS, I am also looking into this issue

AyeshaWaseemAhmad avatar Nov 06 '25 19:11 AyeshaWaseemAhmad

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 4567 has 555 as the area code (first 3 digits) ❌ Invalid
  • +1 415 555 1234 has 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.

AyeshaWaseemAhmad avatar Nov 06 '25 20:11 AyeshaWaseemAhmad