diff options
author | Marco Ambrosini <marcoambrosini@pm.me> | 2019-12-11 10:58:53 +0100 |
---|---|---|
committer | Marco Ambrosini <marcoambrosini@pm.me> | 2019-12-11 15:28:16 +0100 |
commit | 5776a8dc735922d53ad1d32c539907177a65feb7 (patch) | |
tree | 49330ee24e254d839c0bdd033e38455d08f2cc7c /src/components/LeftSidebar/NewGroupConversation/SetConversationName/SetConversationName.vue | |
parent | 9c391ab92dce1a0ddc7828d1923966c2fffb33d0 (diff) |
Properly focus on inputs when they're shown
Signed-off-by: Marco Ambrosini <marcoambrosini@pm.me>
Diffstat (limited to 'src/components/LeftSidebar/NewGroupConversation/SetConversationName/SetConversationName.vue')
-rw-r--r-- | src/components/LeftSidebar/NewGroupConversation/SetConversationName/SetConversationName.vue | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/components/LeftSidebar/NewGroupConversation/SetConversationName/SetConversationName.vue b/src/components/LeftSidebar/NewGroupConversation/SetConversationName/SetConversationName.vue index ca7cc6975..bad2e8931 100644 --- a/src/components/LeftSidebar/NewGroupConversation/SetConversationName/SetConversationName.vue +++ b/src/components/LeftSidebar/NewGroupConversation/SetConversationName/SetConversationName.vue @@ -23,9 +23,11 @@ <div class="set-conversation-name"> <input type="text" - autofocus + :value="value" + ref="conversationName" + v-observe-visibility="visibilityChanged" class="conversation-name" - :placeholder="t('spreed', 'Choose a conversation name')" + :placeholder="t('spreed', 'Conversation name')" @input="handleInput"> </div> </template> @@ -45,6 +47,12 @@ export default { handleInput(event) { this.$emit('input', event.target.value) }, + visibilityChanged(isVisible) { + if (isVisible) { + // Focus the input field of the current componnent. + this.$refs.conversationName.focus() + } + } }, } |