Closed superandrew closed 3 years ago
Hi @superandrew
thanks I could reproduce and pin the problem down.
A quick workaround until this is fixed would be:
<button nxButton="primary small" nxStepperNext (click)="formStepper.controls.step1.controls.select.markAsTouched()" type="button">Next</button>
not 100% correct as the dropdown is not really touched by the user but gives the same result.
The reason what happens:
All controls use the material concept of an errorStateMatcher
which is a class with a method that determines when a control should go into the error state. By default that is only when a control was touched by the user.
In the progress stepper we override the default errorStateMatcher
with one that also triggers the error messages when the next button is clicked even when the formControl wasn't touched yet.
The dropdown is the only component that still has this kind of function baked into the component and is not using the injected errorStateMatcher
. That's easily fixed.
Should be fixed in 11.2.0 👍 https://github.com/aposin/ng-aquila/commit/e8b9b1062b108e97c03e93b4aae94b94dc0c4234
⚡ Reproduction
StackBlitz link to reproduce the issue:
https://stackblitz.com/edit/aquila-issue-crymmr
Steps to reproduce:
📗 Expected Behavior
Errors should be shown for a required dropdown with no values are selected
📕 Actual Behavior
Errors are not shown![CleanShot 2021-03-03 at 16 44 06](https://user-images.githubusercontent.com/71364/109831451-bec07580-7c3f-11eb-97a7-fdb83c9e811e.png)
📦 Environment