Skip to content
This repository has been archived by the owner on Sep 20, 2021. It is now read-only.

backspacing problem #8

Closed
dbaq opened this issue Jan 15, 2016 · 7 comments
Closed

backspacing problem #8

dbaq opened this issue Jan 15, 2016 · 7 comments
Labels
Milestone

Comments

@dbaq
Copy link
Contributor

dbaq commented Jan 15, 2016

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

@cwill747
Copy link
Owner

Thanks for the report, I will take a look!

On Thu, Jan 14, 2016, at 10:41 PM, Didier Baquier wrote:

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!

— Reply to this email directly or view it on GitHub[1].

Links:

  1. backspacing problem #8

@dbaq
Copy link
Contributor Author

dbaq commented Jan 15, 2016

Thanks for the quick answer Cameron. I updated the issue with my findings.

@cwill747
Copy link
Owner

Yeah lemme play around with it some. If it works I'll ask you to open the PR.

@dbaq
Copy link
Contributor Author

dbaq commented Jan 20, 2016

hey Cameron,

any updates on this one?

@cwill747
Copy link
Owner

Hey yeah. Your change looks good to me. Do you want to open a PR or do you want me to change it?

@cwill747 cwill747 added the bug label Jan 22, 2016
@cwill747 cwill747 added this to the v0.0.9 milestone Jan 22, 2016
dbaq pushed a commit to dbaq/angular-libphonenumber that referenced this issue Jan 22, 2016
@dbaq
Copy link
Contributor Author

dbaq commented Jan 22, 2016

Thanks for merging the PR, are you going to push https://github.com/cwill747/angular-libphonenumber/milestones/v0.0.9 anytime soon?

@cwill747
Copy link
Owner

Done!

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

No branches or pull requests

2 participants