Skip to content

Commit

Permalink
fix: confirm form validation needs to be reevaluated on changes on th…
Browse files Browse the repository at this point in the history
…e password form
  • Loading branch information
marvinosswald committed Jun 22, 2021
1 parent ebc41bd commit ed24d72
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ export class MatPasswordStrengthComponent implements OnInit, OnChanges {
this._color = Colors.warn;
return;
} else if (changes.password.previousValue === changes.password.currentValue && !changes.password.firstChange) {
this.calculatePasswordStrength();
this.checkPassword();
} else {
this.password && this.password.length > 0 ?
this.calculatePasswordStrength() : this.reset();
this.checkPassword() : this.reset();
}
}

Expand Down Expand Up @@ -138,6 +138,11 @@ export class MatPasswordStrengthComponent implements OnInit, OnChanges {
return this.containAtCustomChars;
}

private checkPassword(): void {
this.calculatePasswordStrength();
this.passwordConfirmationFormControl.updateValueAndValidity();
}

parseCustomValidatorsRegex(value: string | RegExp = this.customValidator) {
if (this.customValidator instanceof RegExp) {
return this.customValidator;
Expand Down

0 comments on commit ed24d72

Please sign in to comment.