Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui-br-cpf-mask sets model to undefined #328

Open
renanpvaz opened this issue Feb 8, 2018 · 4 comments
Open

ui-br-cpf-mask sets model to undefined #328

renanpvaz opened this issue Feb 8, 2018 · 4 comments

Comments

@renanpvaz
Copy link

I tested it and the other masks seem to work, but the CPF one has something wrong with it. I'm using the 2.6.0 version, which is the latest I found for bower (yes unfortunately I'm using it).

This is how I tried using it (the input is wrapped by a form inside a component's template):

<input
  type="text"
  name="cpf"
  class="form-control"
  placeholder="Digite seu CPF *"
  ng-model="$ctrl.verification.cpf"
  ui-br-cpf-mask
  required
/>

I found, however, a small workaround that has weird behavior sometimes:

<input
  type="text"
  name="cpf"
  class="form-control"
  placeholder="Digite seu CPF *"
  ng-model="$ctrl.verification.cpf"
  ui-br-cpfcnpj-mask
  maxlength="14"
  required
/>

If this has been fixed already, publishing the updated version to bower would really help me out!

@guicercal
Copy link

i have the same issue here, both for cpf and cnpj masks!! :s

@guicercal
Copy link

hey, i found the reason!!! check if the number of cpf is correct!! i tried to use 999.999.999-99 and the mask return undefined, when i put my own cpf number (valid number) the mask return the correct cpf!!

@matheusnicolas
Copy link

I'm having this problem too

@marcoshmendes
Copy link

Add this to field and the validation will be disabled, all values will be accepted

ng-model-options="{ allowInvalid: true }"

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

No branches or pull requests

4 participants