patw0929 / react-intl-tel-input

Rewrite International Telephone Input in React.js. (Looking for maintainers, and PRs & contributors are also welcomed!)
https://patw0929.github.io/react-intl-tel-input/
MIT License
282 stars 221 forks source link

Changing to candian phone number causing a misleading information #238

Open shoshani-ron opened 5 years ago

shoshani-ron commented 5 years ago

While i was using the method handler(status, value, countryData, number, id) and in the IntlTelInput i added those attributes <IntlTelInput //value={value} defaultValue={value} onPhoneNumberChange={this.handler} disabled={this.props.disabled} onPhoneNumberBlur={this.handler} style={{width: '100%', height: 36}} css={['intl-tel-input', 'telephone-input']} utilsScript={'libphonenumber.js'} />

the number that I'm getting from the handler is missing the area codes. so the result that the number is referring as a USA number

For example, the number that I'm entering inside the component is: +1613 XXX XXXX so the number that I'm getting from the handler is +1 XXX XXXX so when the component is rendering to this value it's considering it as USA number

Sergspm commented 5 years ago

I have the same issue, with Canadian numbers. For me works next steps:

  1. Clone the repo into local
  2. Change webpack version into package.json: "webpack": "^2.7.0"
  3. Add to deps next packages: "fs-extra": "^7.0.1", "whatwg-fetch": "^3.0.0", "promise": "^8.0.2"
  4. npm i
  5. npm run build
  6. Include builded files from dist

After this steps phone number inserted correctly.