Giter VIP home page Giter VIP logo

Comments (3)

jackocnr avatar jackocnr commented on May 23, 2024

This seems like an issue with your masking library, not this library! This library doesn't prevent you from typing plus or anything else!

from intl-tel-input.

MohsinRenttango avatar MohsinRenttango commented on May 23, 2024

Thank you for the response. We are not utilizing an external masking library. For masking, we are using the following code:

HTML Code:

<input class="input-phone-field" type="text" minlength="5" (keyup)="onPhoneChange($event)" id="cellphone_1" maxlength="15" formControlName="phone" name="phone" />

TypeScript Code:

var newPlaceholder = (window as any).intlTelInputUtils.getExampleNumber(
  selectedCountryData.iso2,
  true,
  (window as any).intlTelInputUtils.numberFormat.INTERNATIONAL
);
(<any>iti).getSelectedCountryData();
// Reset the phone number input.
(<any>iti).setNumber((<any>iti).getNumber());

// Convert the placeholder as an exploitable mask by replacing all 1-9 numbers with 0s
var mask = newPlaceholder.replace(/[1-9]/g, "0");

// Apply the new mask for the input
$(phoneInputID).mask(mask);

Please suggest a code fix based on this information.

from intl-tel-input.

jackocnr avatar jackocnr commented on May 23, 2024

Well as I said, this library doesn't prohibit you from typing plus or anything else, as you can see from the demo page. So it must be your custom code that is doing this. If you comment out all of your masking code, does that fix the issue?

We are not utilizing an external masking library

You appear to be using the jQuery mask plugin, no?

$(phoneInputID).mask(mask);

from intl-tel-input.

Related Issues (20)

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.