diff options
author | Yoshie Muranaka <yoshiemuranaka@gmail.com> | 2020-05-04 18:24:21 +0300 |
---|---|---|
committer | Derick Montague <derick.montague@ibm.com> | 2020-05-06 18:08:55 +0300 |
commit | 9a9092dc021b10c26dfaba5c39ea02c4fa563f14 (patch) | |
tree | bf6c0b3ded97189d016d4d9ac49809b26eb0427b /src | |
parent | c77fdaf98dd259dbc6b279f76d204916c95feee8 (diff) | |
download | webui-vue-9a9092dc021b10c26dfaba5c39ea02c4fa563f14.tar.xz |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/views/AccessControl/LocalUserManagement/ModalSettings.vue | 16 | ||||
-rw-r--r-- | src/views/AccessControl/LocalUserManagement/ModalUser.vue | 21 |
2 files changed, 27 insertions, 10 deletions
diff --git a/src/views/AccessControl/LocalUserManagement/ModalSettings.vue b/src/views/AccessControl/LocalUserManagement/ModalSettings.vue index 650cd560..8727b20e 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> diff --git a/src/views/AccessControl/LocalUserManagement/ModalUser.vue b/src/views/AccessControl/LocalUserManagement/ModalUser.vue index baf49e91..b426dd91 100644 --- a/src/views/AccessControl/LocalUserManagement/ModalUser.vue +++ b/src/views/AccessControl/LocalUserManagement/ModalUser.vue @@ -8,7 +8,7 @@ {{ $t('pageLocalUserManagement.editUser') }} </template> </template> - <b-form novalidate @submit="handleSubmit"> + <b-form id="form-user" novalidate @submit.prevent="handleSubmit"> <b-container> <!-- Manual unlock form control --> <b-row v-if="!newUser && manualUnlockPolicy && user.Locked"> @@ -186,13 +186,18 @@ </b-row> </b-container> </b-form> - <template v-slot:modal-ok> - <template v-if="newUser"> - {{ $t('pageLocalUserManagement.addUser') }} - </template> - <template v-else> - {{ $t('global.action.save') }} - </template> + <template v-slot:modal-footer="{ ok, cancel }"> + <b-button variant="secondary" @click="cancel()"> + {{ $t('global.action.cancel') }} + </b-button> + <b-button form="form-user" type="submit" variant="primary" @click="ok()"> + <template v-if="newUser"> + {{ $t('pageLocalUserManagement.addUser') }} + </template> + <template v-else> + {{ $t('global.action.save') }} + </template> + </b-button> </template> </b-modal> </template> |