This is an automated email from the ASF dual-hosted git repository.

dahn pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/main by this push:
     new 7b02c4cc482 Add autofocus to 2FA input (#8766)
7b02c4cc482 is described below

commit 7b02c4cc482a97fe5efcf243a20f04769109e056
Author: Lucas Martins <[email protected]>
AuthorDate: Fri Mar 15 10:59:58 2024 -0300

    Add autofocus to 2FA input (#8766)
---
 ui/src/views/dashboard/VerifyTwoFa.vue | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/ui/src/views/dashboard/VerifyTwoFa.vue 
b/ui/src/views/dashboard/VerifyTwoFa.vue
index 6456bf203fc..0d6ec52b87e 100644
--- a/ui/src/views/dashboard/VerifyTwoFa.vue
+++ b/ui/src/views/dashboard/VerifyTwoFa.vue
@@ -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)

Reply via email to