refs #537 Focus on new toot modal after change account

This commit is contained in:
AkiraFukushima 2018-08-20 21:38:38 +09:00
parent a5c49a7ccd
commit 8042b880bd
1 changed files with 6 additions and 0 deletions

View File

@ -71,10 +71,16 @@ export default {
}
}
},
mounted () {
// When change account, the new toot modal is recreated.
// So can not catch open event in watch.
this.$refs.status.focus()
},
watch: {
opened: function (newState, oldState) {
if (!oldState && newState) {
this.$nextTick(function () {
console.log('focus')
this.$refs.status.focus()
})
} else if (oldState && !newState) {