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

backspacing problem #8

@dbaq

Description

@dbaq

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions