PhoneInput: controllable country + detect country from pasted numbers
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- react, typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- TypeScript
- Star
- 39
- Fork
- 16
- Merge trung bình
- 2 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 10
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của babelize/babelize-elements
-
bug website
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
babelize/babelize-elements#46 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug language-switcher priority: medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
babelize/babelize-elements#26 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
component enhancement help wanted
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
babelize/babelize-elements#47 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug component rtl-layout
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
babelize/babelize-elements#45 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Website: revamp and improve the landing pageCó thể đã có người làm @anjalinayak01 đã nhận 5 ngày trước. Đang mởenhancement help wanted priority: medium website
Độ khó 4/5 Hơn một tuần Mức phù hợp với người mới 30/100
babelize/babelize-elements#37 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của babelize/babelize-elements
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
callstackincubator/simlock#639 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
aws/agentcore-cli#2606 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ai-driven-qa bug Cosmetic
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ai-driven-qa bug claude Minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
linagora/twake-mail-admin#301 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày