question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

formatting is not working as specified in libphonenumber

See original GitHub issue

Hi, I am using react-phone-number-input/basic-input as below : `` Using app created via create-react-app with no webpack. Now if I enter 20 the number formatted as (20 ) and caret goes after parenthesis. But as per below link https://libphonenumber.appspot.com/phonenumberparser?number=2071234567&country=US the number should only if I type (207) 123-45. Is there a way I can get the number formatted only after I type more then three char atleast.

Also when I try to use SmartInput as below:

`import PhoneInput from “react-phone-number-input/basic-input”;

import SmartInput from ‘react-phone-number-input/smart-input’

    <PhoneInput

      inputComponent={SmartInput}

      className="react-phone-number-input__input"
      country={region}
      smartCaret={ true }
      value={this.state.mobileNumber}
      placeholder={this.props.intl.formatMessage(messages.phonePlaceholder)}
      onChange={this.onUpdatePhone}
      onBlur={event => this.onBlurValidate(event)}
    />

`

I get warning and it doesn’t work:

Warning: React does not recognize the inputComponent prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase inputcomponent instead. If you accidentally passed it from a parent component, remove it from the DOM element. in input (created by InputBasic) in InputBasic (created by InputBasicDefaultMetadata) in InputBasicDefaultMetadata (at PhoneNumber.js:54) in div (created by styled.div) in styled.div (at PhoneNumber.js:53) in PhoneNumber (created by InjectIntl(PhoneNumber))

Thanks Manish

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
msita143commented, Aug 2, 2018

gr8 response. thanks

1reaction
msita143commented, Aug 2, 2018

oh ok. How long will it take. else I need to look into use other lib for fix yrs locally.

Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

libphonenumber/FAQ.md at master
Some "valid" numbers are not formatting correctly. This could be due to number simplification. In order to keep the size of the XML...
Read more >
How to format a phone numbers with libphonenumber in ...
Remember to use phoneUtil.IsValidNumber if you aren't certain that the phone number is valid. Also be aware that phoneUtil.Parse may throw.
Read more >
Using libphonenumber for International Phone Numbers
Libphonenumber is Google's formatting, parsing, and validation tool for international phone numbers. Learn how to use it in your global apps ...
Read more >
PhoneNumberUtil (libphonenumber 8.9.1 API) - javadoc.io
Formats a phone number in the specified format using client-defined formatting rules. Note that if the phone number has a country calling code...
Read more >
google-libphonenumber
Start using google-libphonenumber in your project by running `npm i ... as it attempts to discover the right format for the given number....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found