From 48aa30c00068fc110bcbeefabde6b9ebb207c832 Mon Sep 17 00:00:00 2001
From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com>
Date: Thu, 25 Feb 2021 11:56:24 +0100
Subject: [PATCH] fix(navigation) : add enter key on form

---
 src/app/form/footer-form/footer-form.component.html | 1 +
 src/app/form/footer-form/footer-form.component.scss | 2 +-
 src/app/form/form.component.html                    | 4 ++--
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/app/form/footer-form/footer-form.component.html b/src/app/form/footer-form/footer-form.component.html
index c2e91330f..a2d4f21ff 100644
--- a/src/app/form/footer-form/footer-form.component.html
+++ b/src/app/form/footer-form/footer-form.component.html
@@ -11,6 +11,7 @@
     class="btn-primary small next"
     (click)="goToNextPage()"
     [disabled]="!isValid"
+    type="submit"
     [ngClass]="{ invalid: !isValid }"
   >
     <div class="rowBtn" fxLayout="row" fxLayoutAlign="center center">
diff --git a/src/app/form/footer-form/footer-form.component.scss b/src/app/form/footer-form/footer-form.component.scss
index 31dbd2f3b..6ebf95c44 100644
--- a/src/app/form/footer-form/footer-form.component.scss
+++ b/src/app/form/footer-form/footer-form.component.scss
@@ -25,6 +25,6 @@
 .chevronRight {
   height: 24px;
   width: 24px;
-  stroke: $white;
+  stroke: inherit;
   margin-left: 10px;
 }
diff --git a/src/app/form/form.component.html b/src/app/form/form.component.html
index b88d6be47..42e688ad1 100644
--- a/src/app/form/form.component.html
+++ b/src/app/form/form.component.html
@@ -105,7 +105,7 @@
         </ul>
       </div>
     </div>
-    <form [formGroup]="accountForm" *ngIf="accountForm && !profile">
+    <form [formGroup]="accountForm" *ngIf="accountForm && !profile" (keyup.enter)="isPageValid && !isEditMode? nextPage() : null">
       <div *ngIf="currentPage == pageTypeEnum.accountInfo" class="page">
         <div class="title">
           <h3>Qui êtes-vous ?</h3>
@@ -241,7 +241,7 @@
         </div>
       </div>
     </form>
-    <form [formGroup]="structureForm" *ngIf="structureForm">
+    <form [formGroup]="structureForm" *ngIf="structureForm" (keyup.enter)="isPageValid && !isEditMode? nextPage() : null">
       <div *ngIf="currentPage == pageTypeEnum.structureNameAndAddress" class="page">
         <div class="title">
           <h3>Quelle structure voulez-vous réferencer ?</h3>
-- 
GitLab