Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/polls.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/js
diff options
context:
space:
mode:
authordartcafe <github@dartcafe.de>2020-01-26 14:56:25 +0300
committerdartcafe <github@dartcafe.de>2020-01-26 14:56:25 +0300
commita428b645d80b5f2d63e1fcfac0b8bfa5d0819dd4 (patch)
tree702ae4d64adbfd557145ccf91a99a6adf166b216 /src/js
parentfc62fa5a905a08dcd194d3daf9c58137004d85fd (diff)
set focus to input username
Diffstat (limited to 'src/js')
-rw-r--r--src/js/components/VoteTable/VoteHeaderPublic.vue12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/js/components/VoteTable/VoteHeaderPublic.vue b/src/js/components/VoteTable/VoteHeaderPublic.vue
index 8e0b247a..ecdfc334 100644
--- a/src/js/components/VoteTable/VoteHeaderPublic.vue
+++ b/src/js/components/VoteTable/VoteHeaderPublic.vue
@@ -33,7 +33,7 @@
<p>{{ t('polls', 'To participate, you need to enter a valid username with at least 3 characters. ') }}</p>
- <input v-model="userName" :class="{ error: (!isValidName && userName.length > 0), success: isValidName }" type="text"
+ <input v-model="userName" ref="userName" :class="{ error: (!isValidName && userName.length > 0), success: isValidName }" type="text"
:placeholder="t('polls', 'Enter your name')" @keyup.enter="writeUserName">
<div>
<span v-show="checkingUserName" class="icon-loading-small">Checking user name... </span>
@@ -111,7 +111,17 @@ export default {
}
},
+ mounted() {
+ this.setFocus()
+ },
+
methods: {
+ setFocus() {
+ this.$nextTick(() => {
+ this.$refs.userName.focus()
+ })
+ },
+
showModal() {
this.modal = true
},