Coder Social home page Coder Social logo

angular-libphonenumber's People

Contributors

cwill747 avatar greenkeeperio-bot avatar mohammedzamakhan avatar skoblenick avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

angular-libphonenumber's Issues

backspacing problem

Overview of the Issue
When using the singapore country code ("sg") and entering 012345, the backspace key works fine to remove the 5 but then got stuck and cannot remove 01234.
screen shot 2016-01-14 at 7 31 23 pm
screen shot 2016-01-14 at 7 31 33 pm

Angular Version: v1.4.3
Angular libphonenumber Version: 0.0.7
Browsers and Operating System: Able to reproduce on chrome and on mobile devices via cordova
Reproduce the Error: just run the basic example with singapore country code, enter 012345 then try to delete.
Suggest a Fix: I was not able to isolate the part of the code yet.

Thanks for your help!

EDIT 1: By triming the returned value of the clean function, the problem disappears. Replace that line (https://github.com/cwill747/angular-libphonenumber/blob/master/src/phone-number.js#L91) by:

-return formattedValue;
+return formattedValue.trim();

Before opening a PR, I would like to know your thoughts on the issue and make sure it won't cause any regression. Thanks

Angular as a devDependency

Hi,

thanks for your directive, very useful. Can the bower.json be changed so that angular is a devDependency not a dependency? I am using your directive with ionic which already import angular, that causes conflict.

Thanks

Remove output from validator or add the ability to not validate as you type

Expected Behavior

I would like to not receive console output for every number entered as I type a phone number

Possible Solution

Either remove the line that outputs that the phone number is not valid, at least in the release versions, or add an option to not validate as I type similar to what you did with the formatter.

Allow explicit prefix in number to override country code

Feel free to close when it’s out of scope.
Thanks for your attention!

Expected Behavior

libphonenumber-validate-explicit-foreign-number

In libphonenumber, setting the country code works as a fallback. If I set the country code to BE, it will try to parse numbers without an explicit country prefix as a Belgian number. If, however, I provide a Dutch phone number, as long as I include the Dutch prefix +31, it will validate as well.

Current Behavior

angular-libphonenumber-validate-explicit-foreign-number

In angular-libphonenumber, the country code takes precedence over the prefix. If I set the country code to BE, only Belgian numbers ever validate. If I enter a Dutch phone number +31 6 12345678, it will be marked as invalid.

Possible Solution

It could be that I’ve overlooked a setting somewhere and this behaviour is already possible!

Otherwise, I haven’t yet looked into the internals of libphonenumber and angular-libphonenumber, so I’m not sure how easy it would be to reproduce libphonenumber’s behaviour.

Steps to Reproduce (for bugs)

In https://run.plnkr.co/plunks/k32xZLSRS47w6TW3auAF/ set the country code to BE and try to validate +31 6 12345678.

Context

The context is any application that is used by an organisation or company mainly active in one country, but who will occasionally deal with international users. These users might not have a national phone number, but they will be aware that they need to add their prefix. The national users will be entering their data in various forms, in many cases without the prefix.

Your Environment

I used the online demo available at: https://run.plnkr.co/plunks/k32xZLSRS47w6TW3auAF/

Bower install should automatically install both files

Expected Behavior

bower install --save angular-libphonenumber
Should include both files with tools like gulp / wiredep

  • angular-libphonenumber.js
  • libphonenumber.js

Current Behavior

Currently it just includes

  • angular-libphonenumber.js

Possible Solution

Add libphonenumber.js to main in bower.json

Steps to Reproduce (for bugs)

  1. Use gulp/wiredep
  2. bower install --save angular-libphonenumber
  3. Error about phoneUtils

Push version up for libphonenumber.full.js

Your current version 0.0.9 does not include the libphonenumber.full.js file, so when you install via bower you do not get that thing. You have to reference the commit directly which is quite dirty imho:

bower install angular-libphonenumber#672c4195a0b95692f94cf73cd6964762171c45f4

Please bump your version up so the current state (including libphonenumber.full.js) can be referenced by bower without dirty hacks.

Adding a country code after entering the phone number behaves strangely

Expected Behavior

You should be able to enter a phone number without the cursor jumping around,

Current Behavior

When trying to add an area code the cursor jumps around

Steps to Reproduce

  1. Enter 02012341234 country code gb.
  2. Try changing the first zero to a +44
  3. watch as the cursor moves around as you type

Cursor does not move to end of input when number is reformatted

The cursor does not follow the formatting correctly.

Expected Behavior

As the number is formatted automatically the cursor should move to the end so new numbers can be inserted.

Current Behavior

As the number is typed spaces are automatically inserted.
The cursor does not move to after the last inserted number. It remains in front and so the next number being added is inserted in front of the last.

Possible Solution

Ensure that the cursor is always at the end of the number being typed.

libphonenumber library is incomplete

Hey @cwill747, hope you're doing well.

Overview of the Issue and Motivation for or Use Case
Since v0.0.9 and more specifically this commit 195713a. I can't use this plugin since you removed some functionalities that I was using (including phoneUtils.formatE164).

I naturally tried to used https://raw.githubusercontent.com/nathanhammond/libphonenumber/master/dist/libphonenumber.js directly but phoneUtils.formatAsTyped is not defined in that file.

Angular libphonenumber Version(s)
0.0.9
Browsers and Operating System
is this a problem with all browsers? no
Suggest a Fix

  • where is this phoneUtils.formatAsTyped coming from?
  • if you want to keep libphonenumber.js without all the phoneUtils export, we should at least be able to use the libphonenumber.js from @nathanhammond/libphonenumber to use other functions, no? What do you think?

Thanks for your help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.