diff --git a/src/app/shared/components/presentationals/shared-stepper/shared-stepper.presentational.html b/src/app/shared/components/presentationals/shared-stepper/shared-stepper.presentational.html index 5f42be01f82b5d9b8141cf94d4b07d6dc387b1ba..2e597750558a62a964cf96a49b921c98cc4924f8 100644 --- a/src/app/shared/components/presentationals/shared-stepper/shared-stepper.presentational.html +++ b/src/app/shared/components/presentationals/shared-stepper/shared-stepper.presentational.html @@ -5,8 +5,8 @@ (onEnter)="desireGoTo(step)" [class.is-in-error]="(step.numberErrors | isNotNullNorUndefined) && (step.numberErrors() | solidifyAsync) > 0" [class.is-active]="i <= currentStepIndex" - [class.is-clickable]="i < currentStepIndex || i == currentStepIndex + 1" - [matRippleDisabled]="i > currentStepIndex + 1 || i == currentStepIndex" + [class.is-clickable]="(i < currentStepIndex || i == currentStepIndex + 1) && currentStepValid" + [matRippleDisabled]="i > currentStepIndex + 1 || i == currentStepIndex || !currentStepValid" [solidifyDataTest]="step.dataTest" [tabIndex]="0" class="step-header step-{{step.id | lowercase}}" diff --git a/src/app/shared/components/presentationals/shared-stepper/shared-stepper.presentational.ts b/src/app/shared/components/presentationals/shared-stepper/shared-stepper.presentational.ts index a7ecea288e1a3b03c061328a757e16e7838bbd71..b64200d05e3a9ac027177d96fab07e1897be9074 100644 --- a/src/app/shared/components/presentationals/shared-stepper/shared-stepper.presentational.ts +++ b/src/app/shared/components/presentationals/shared-stepper/shared-stepper.presentational.ts @@ -30,6 +30,7 @@ import { import { AbstractContainer, isNotNullNorUndefined, + isTrue, ObservableUtil, ScrollService, } from "solidify-frontend"; @@ -67,6 +68,11 @@ export class SharedStepperPresentational extends AbstractContainer implements On @Input() stepTourAnchor: string; + get currentStepValid(): boolean { + const isInvalid = this?.currentStep?.stepFormAbstractControl?.invalid; + return !isTrue(isInvalid); + } + constructor(private readonly _store: Store, private readonly _router: Router, private readonly _route: ActivatedRoute, @@ -110,6 +116,9 @@ export class SharedStepperPresentational extends AbstractContainer implements On } desireGoTo(step: Step): void { + if (!this.currentStepValid) { + return; + } if (this.currentStep === step) { return; }