From 9a9092dc021b10c26dfaba5c39ea02c4fa563f14 Mon Sep 17 00:00:00 2001
From: Yoshie Muranaka <yoshiemuranaka@gmail.com>
Date: Mon, 4 May 2020 08:24:21 -0700
Subject: Fix accessibility issue on local user page

Updates template to use form attribute on submit button to allow
keyboard users to submit modal forms with the enter key. These
updates were made to the local user add/edit modal and the
account settings modal.

Signed-off-by: Yoshie Muranaka <yoshiemuranaka@gmail.com>
Change-Id: Id217cd68e4576ee099598591df6edbead0f1de8b
---
 .../AccessControl/LocalUserManagement/ModalSettings.vue  | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

(limited to 'src/views/AccessControl/LocalUserManagement/ModalSettings.vue')

diff --git a/src/views/AccessControl/LocalUserManagement/ModalSettings.vue b/src/views/AccessControl/LocalUserManagement/ModalSettings.vue
index 650cd5608..8727b20e5 100644
--- a/src/views/AccessControl/LocalUserManagement/ModalSettings.vue
+++ b/src/views/AccessControl/LocalUserManagement/ModalSettings.vue
@@ -3,11 +3,10 @@
     id="modal-settings"
     ref="modal"
     :title="$t('pageLocalUserManagement.accountPolicySettings')"
-    :ok-title="$t('global.action.save')"
     @ok="onOk"
     @hidden="resetForm"
   >
-    <b-form novalidate @submit="handleSubmit">
+    <b-form id="form-settings" novalidate @submit.prevent="handleSubmit">
       <b-container>
         <b-row>
           <b-col>
@@ -102,6 +101,19 @@
         </b-row>
       </b-container>
     </b-form>
+    <template v-slot:modal-footer="{ ok, cancel }">
+      <b-button variant="secondary" @click="cancel()">
+        {{ $t('global.action.cancel') }}
+      </b-button>
+      <b-button
+        form="form-settings"
+        type="submit"
+        variant="primary"
+        @click="ok()"
+      >
+        {{ $t('global.action.save') }}
+      </b-button>
+    </template>
   </b-modal>
 </template>
 
-- 
cgit v1.2.3

