i have implemented a custom form control with custom validation but i can't manage to mark the control as invalid once the parent form is submitted i want that when user press submit the control gets invalidated.. so far it gets invalidated only when touching it.. in my onDoCheck i manage to read the form.isSubmitted property but i noticed that the control is still marked as "valid"
even if i build the logic and force it as invalid in my onDoChek.. that way in the parent component on submit i can't check for the control validity because i would set it after the onSubmit callback.. what am i missing here?
the ugly fix i can think of is adding
this.form.get('test').updateValueAndValidity();
this.form.get('test').markAsTouched();
on the onSubmit callback, but shouldn't it work out of the box without doing that?
here the stackblitz: https://stackblitz.com/edit/angular-k5un7v?file=src%2Fapp%2Fcustom-input%2Fcustom-input.component.ts
any help is greatly appreciated