From ef6ac2fe245597610ca8b87741d46a2cf19321c0 Mon Sep 17 00:00:00 2001 From: WilliamAguera Date: Tue, 1 Oct 2019 16:41:35 -0300 Subject: [PATCH] fix(step-finish): fix validation property [validateForm] not working on step finish. --- .../step/directives/step-finish.directive.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/projects/truly-ui/src/components/step/directives/step-finish.directive.ts b/projects/truly-ui/src/components/step/directives/step-finish.directive.ts index 77a7375ee..1fe8a756d 100644 --- a/projects/truly-ui/src/components/step/directives/step-finish.directive.ts +++ b/projects/truly-ui/src/components/step/directives/step-finish.directive.ts @@ -16,6 +16,10 @@ export class StepFinishDirective implements AfterViewInit, OnInit { @HostListener('click') onClick() { + if ( !this.stepService.isValidateForm() ) { + this.stepService.finish(); + return; + } if (this.stepService.isFormValid()) { this.stepService.finish(); } @@ -36,8 +40,10 @@ export class StepFinishDirective implements AfterViewInit, OnInit { } private setDisabled() { - this.button.disabled = !this.stepService.isFormValid(); - this.change.detectChanges(); + if ( this.stepService.isValidateForm()) { + this.button.disabled = !this.stepService.isFormValid(); + this.change.detectChanges(); + } } private changes() {