Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

9 digit French phone number input is causing issues for my users, and the enableLongNumbers prop does not allow setting to 10 #662

Open
pmnord opened this issue Dec 22, 2023 · 1 comment

Comments

@pmnord
Copy link

pmnord commented Dec 22, 2023

// Does exceed default 15 digit phone number limit

    // Does exceed default 15 digit phone number limit
    if (value.replace(/\D/g, '').length > 15) {
      if (this.props.enableLongNumbers === false) return;
      if (typeof this.props.enableLongNumbers === 'number') {
        if (value.replace(/\D/g, '').length > this.props.enableLongNumbers) return;
      }
    }

I'm trying to set the input limit to 10 in the case of French users, who are expecting the following format XX XX XX XX XX but currently react-phone-input-2 uses X XX XX XX XX which is not what my French users expect and is causing user errors when inputting.

Is it possible to either change the formatting of French phone number inputs to XX XX XX XX XX, or else allow enableLongNumbers to be set at 10?

@pmnord
Copy link
Author

pmnord commented Dec 23, 2023

I've opened a PR here: #663

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant