Merge pull request #539 from h3poteto/iss-537

closes #537 Focus on new toot modal after change account
This commit is contained in:
AkiraFukushima 2018-08-20 21:44:49 +09:00 committed by GitHub
commit 9c16775606
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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) {