Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

PhoneInput: full country list + basic E.164 validation

Aperta
#32 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
react, typescript

Direzione di ricerca

The payload names no file, so start by locating the existing PhoneInput component and its 50-country list in the repository. Replace the list with the full E.164 set, add the optional countries and preferredCountries props, and add basic digits-only, 15-digit validation that sets aria-invalid and calls onValidityChange(valid, e164). Done when the tests check every entry's ISO code and dial code, filtering, and the callback, and the PR notes the bundle size.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement help wanted priority: low

PhoneInput: full country list + basic E.164 validation

PhoneInput currently ships 50 countries, so users in most of the world (e.g. Sri Lanka, Nepal, Peru, Morocco, Ukraine) can't select their dial code.

Proposal
  1. Full list — all ITU-T E.164 country codes (~245 entries). Flags can be derived from the ISO code rather than stored, and English names via Intl.DisplayNames to keep bundle size down.
  2. Optional countries prop — allow consumers to restrict / reorder the list (e.g. ["IN", "US", "GB"]), plus preferredCountries pinned at the top.
  3. Basic validation — strip formatting characters, enforce digits-only and E.164 max length (15 digits incl. country code); expose aria-invalid and an onValidityChange(valid, e164) callback. Full per-country rules (libphonenumber) stay out of scope to keep zero extra deps.
Acceptance
  • Test that every entry has a valid ISO code and +-prefixed dial code
  • Tests for countries filtering and validation callback
  • Bundle size noted in the PR
Lingua principale
TypeScript
Stelle
39
Fork
16
Merge medio
2g 12h
PR unite (30g)
10

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di babelize/babelize-elements

Tutte le issue di babelize/babelize-elements

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.