From 602c8e349db28f4c98197c7a1614f7460af112da Mon Sep 17 00:00:00 2001
From: AkiraFukushima
Date: Tue, 10 Apr 2018 23:13:43 +0900
Subject: [PATCH] fix: Set focus in watch directive on newToot
---
.../components/TimelineSpace/Modals/NewToot.vue | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/renderer/components/TimelineSpace/Modals/NewToot.vue b/src/renderer/components/TimelineSpace/Modals/NewToot.vue
index 84ec1012e7..26f372d356 100644
--- a/src/renderer/components/TimelineSpace/Modals/NewToot.vue
+++ b/src/renderer/components/TimelineSpace/Modals/NewToot.vue
@@ -6,7 +6,7 @@
class="new-toot-modal">
-
+
@@ -67,9 +67,13 @@ export default {
}
}
},
- updated () {
- if (this.newTootModal) {
- this.$refs.status.focus()
+ watch: {
+ newTootModal: function (newState, oldState) {
+ if (!oldState && newState) {
+ this.$nextTick(function () {
+ this.$refs.status.focus()
+ })
+ }
}
},
methods: {