1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-01-29 22:31:29 +01:00
bitwarden-browser/angular/src/validators/dirty.validator.ts
Thomas Rittson adfc2f234d
Remove unused SSO Form code (#701)
* Remove unused SAML Artifact Binding properties

* Remove unused validators
2022-03-03 07:52:11 +10:00

10 lines
373 B
TypeScript

import { AbstractControl, ValidationErrors, Validators } from "@angular/forms";
/**
* Runs Validators.required on a field only if it's dirty. This prevents error messages from being displayed
* to the user prematurely.
*/
export function dirtyRequired(control: AbstractControl): ValidationErrors | null {
return control.dirty ? Validators.required(control) : null;
}