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.
that's known issue https://github.com/angular/angular/issues/7822 , fixed when pull request lands https://github.com/angular/angular/pull/7421
Comments
Post a Comment