mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Add autofocus to 2FA input (#8766)
This commit is contained in:
parent
bb244842fa
commit
7b02c4cc48
@ -71,6 +71,11 @@ export default {
|
||||
created () {
|
||||
this.initForm()
|
||||
},
|
||||
mounted () {
|
||||
this.$nextTick(() => {
|
||||
this.focusInput()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
initForm () {
|
||||
this.formRef = ref()
|
||||
@ -79,6 +84,12 @@ export default {
|
||||
code: [{ required: true, message: this.$t('message.error.authentication.code') }]
|
||||
})
|
||||
},
|
||||
focusInput () {
|
||||
const inputElement = this.$refs.code.$el.querySelector('input[type=password]')
|
||||
if (inputElement) {
|
||||
inputElement.focus()
|
||||
}
|
||||
},
|
||||
handleSubmit () {
|
||||
this.formRef.value.validate().then(() => {
|
||||
const values = toRaw(this.form)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user