amarkes / br-mask

MIT License
116 stars 56 forks source link

br-mask ngIf issue - Android devices #38

Open marcionavas opened 4 years ago

marcionavas commented 4 years ago

In my Ionic 4 App I have a reactive form where I validate some information and show an error under the field using an ngIf for this in my html code. aside from validation I'd like to use a mask in my phone, cpf and cnpj fields. For this I'm using br-mask. My issue is that when I add br-mask to my input field, it apparently inhibits the field.dirty condition from working, consequently not showing my error message. My code follows:

`

Telefone
  <ion-input type="tel" formControlName="num_telefone" [(ngModel)]="Ptype().num_telefone"
    placeholder="(99) 99999-9999" **[brmasker]="{phone: true}"**></ion-input>
</ion-item>
<div class="error-container">
  <ng-container *ngFor="let validation of validations.validations.telefone">
    <div class="error-message"
      ***ngIf="registerForm.get('num_telefone').hasError(validation.type) && (registerForm.get('num_telefone').dirty || registerForm.get('num_telefone').touched)"**>
      <ion-icon name="information-circle-outline"></ion-icon>
      <span>{{ validation.message }}</span>
    </div>
  </ng-container>
</div>`

Thanks in advance!