Skip to content

PhoneNumberField still decomposes only four seeded dial codes #914

Description

@marassteiner

Summary

PR #909 opened the prefix input to any 1–3 digit dial code, but seeded-value decomposition still walks a closed list of four codes (+41, +49, +43, +423) and falls back to +41 plus an empty national field for everything else. A stored +33…, +1…, +7…, or +420… number is therefore still shown as 41 with a blank number; the user has to re-type the whole number before submit.

Found while reviewing #909. Not a merge-blocker: this is the pre-existing seed path, now improved for +43 / +423. New input of any 1–3 digit prefix already works. The PR body explicitly rejected a full country-code picker.

Evidence

  • lib/widgets/form/phone_number_field.dart:18final prefixes = ['+41', '+49', '+43', '+423'];
  • lib/widgets/form/phone_number_field.dart:28-34 — longest-first match only against that list
  • lib/widgets/form/phone_number_field.dart:42prefix ??= prefixes.first; (+41)
  • test/screens/kyc/steps/kyc_personal_data_page_test.dart:178-183 — pins the +336… → displayed 41 fallback
  • Call sites that seed from the API and later submit phoneCtrl.value: lib/screens/kyc/steps/personal_data/kyc_personal_data_page.dart:140, registration personal step

Suggested follow-up

  • Decompose seeded values with a complete, longest-first calling-code table used only for split-on-prefill, never as an input allow-list (CONTRIBUTING: the API decides whether a dial code exists).
  • Or have the API return prefix and national number separately so the client does not guess.
  • Add prefill tests for +1, +7, and an unknown 2-/3-digit code.

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions