Fix Safari default dropdown on Local user management page
Currently when creating a new user on the Local user management page,
the 'Administrator' privilege appears to be selected by default but in
Safari causes inline validations errors if attempting to submit the form
without manually choosing an option from the dropdown.
This commit will add a default "Select an option" item from the dropdown
to avoid inconsistent default select behavior in Safari.
Signed-off-by: Yoshie Muranaka <yoshiemuranaka@gmail.com>
Change-Id: I779fd62a516faf7dc88fe4992ec36c0c23a44cce
diff --git a/src/views/AccessControl/LocalUserManagement/ModalUser.vue b/src/views/AccessControl/LocalUserManagement/ModalUser.vue
index 962718b..7ef9260 100644
--- a/src/views/AccessControl/LocalUserManagement/ModalUser.vue
+++ b/src/views/AccessControl/LocalUserManagement/ModalUser.vue
@@ -114,6 +114,11 @@
:state="getValidationState($v.form.privilege)"
@input="$v.form.privilege.$touch()"
>
+ <template #first>
+ <b-form-select-option :value="null" disabled>
+ {{ $t('global.form.selectAnOption') }}
+ </b-form-select-option>
+ </template>
</b-form-select>
<b-form-invalid-feedback role="alert">
<template v-if="!$v.form.privilege.required">
@@ -258,7 +263,7 @@
form: {
status: true,
username: '',
- privilege: '',
+ privilege: null,
password: '',
passwordConfirmation: '',
manualUnlock: false,
@@ -368,7 +373,7 @@
this.form.originalUsername = '';
this.form.status = true;
this.form.username = '';
- this.form.privilege = '';
+ this.form.privilege = null;
this.form.password = '';
this.form.passwordConfirmation = '';
this.$v.$reset();