PhoneInput: controllable country + detect country from pasted numbers
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- react, typescript
- Área
- frontend
Línea de trabajo
Start with the PhoneInput component's selectedCountry state, initialised from defaultCountry via getCountryByCode and COUNTRIES, and read ARCHITECTURE.md for the controlled/uncontrolled pattern and the useControllableState helper. Add country and onCountryChange props, then handle a leading + in the input by matching the longest dial code and stripping the prefix. Done when the acceptance tests pass: a controlled country follows the parent, pasting +44 selects GB, and +1 keeps CA when CA is selected, and the props table in the docs is updated.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
PhoneInput: controllable country + detect country from pasted numbers
Today the selected country is internal state seeded once from defaultCountry:
const [selectedCountry, setSelectedCountry] = React.useState(() => getCountryByCode(defaultCountry) ?? COUNTRIES[0]);
This breaks the library's controlled/uncontrolled convention (see ARCHITECTURE.md) — a parent can't change or reset the country, and changing defaultCountry after mount does nothing.
Proposal
- Add
country/onCountryChangeand route both throughuseControllableState; keepdefaultCountryfor uncontrolled use. - When the user types or pastes a number starting with
+(e.g.+44 20 7946 0958), match the longest dial code, switch the country and strip the prefix from the input value. - Shared dial codes (
+1US/CA,+7RU/KZ): keep the currently selected country if it matches, else pick the first.
Acceptance
- Tests: controlled country follows parent; paste
+44…selects GB;+1keeps CA if CA selected - Docs updated with props table
- Lenguaje dominante
- TypeScript
- Estrellas
- 39
- Forks
- 16
- Merge medio
- 2 d 12 h
- PR fusionados (30 d)
- 10
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de babelize/babelize-elements
-
bug website
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
babelize/babelize-elements#46 ·
Los mantenedores suelen responder en 1 día
-
bug language-switcher priority: medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
babelize/babelize-elements#26 ·
Los mantenedores suelen responder en 1 día
-
component enhancement help wanted
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
babelize/babelize-elements#47 ·
Los mantenedores suelen responder en 1 día
-
bug component rtl-layout
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
babelize/babelize-elements#45 ·
Los mantenedores suelen responder en 1 día
-
Website: revamp and improve the landing pagePosiblemente ocupada @anjalinayak01 la tomó hace 4 días. Abiertoenhancement help wanted priority: medium website
Dificultad 4/5 Más de una semana Aptitud para principiantes 30/100
babelize/babelize-elements#37 · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de babelize/babelize-elements
Issues similares
-
fix(frontend): correct VITE_IS_DEVELPOMENT typo in shared/app.ts and align dev environment flagsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
vicharanashala/ajrasakha#1439 ·
Los mantenedores suelen responder en 1 día
-
Add: TV5Monde AsieAbiertoapproved check:passed streams:add
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
backnotprop/plannotator#1932 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 Medio día Aptitud para principiantes 62/100
ibm-granite/granite.build#504 ·
Los mantenedores suelen responder en 2 días
-
reproduced
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
anomalyco/opencode#55676 · 1 comentario ·
Los mantenedores suelen responder en 1 día