forms - Input field with validation crashes when typing fast in Angular 2 -


i have form in angular 2 simple validation using validators.

the html template

<form role="form" #myform="ngform" (ngsubmit)="submit()" novalidate [ngformmodel]="form">     <div class="form-group  list-element">         <label for="name">name*</label>         <input type="text" name="name" class="form-control" ngcontrol="name"                #name="ngform" placeholder="enter name" [(ngmodel)]=user.name >     </div> </form> 

the controlgroup validation

ngoninit() {         this.form = new controlgroup({       name: new control('', validators.compose([         validators.required,         validators.pattern("(([a-za-z ]|[0-9])+)*"),         validators.minlength(5),         validators.maxlength(80)       ]))     });   } 

when type fast (random) characters in input field (e.g #1kzbzkbjkndedjk@@@kjbzdzdékj!) application crashes. not happen have not noticed pattern.

this place crash happens, think crash has pattern. enter image description here

that's known issue https://github.com/angular/angular/issues/7822 , fixed when pull request lands https://github.com/angular/angular/pull/7421


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -