Skip to content

Commit

Permalink
Merge pull request #3522 from h3poteto/fix-3300/new-toot
Browse files Browse the repository at this point in the history
refs #3300 Fix focus of NewToot modal
  • Loading branch information
h3poteto committed Jul 21, 2022
2 parents 27dcbe4 + 9769319 commit 74ed5fd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/renderer/components/TimelineSpace/Modals/Jump.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ export default defineComponent({
store.dispatch(`${space}/${ACTION_TYPES.SYNC_LIST_CHANNEL}`)
store.dispatch(`${space}/${ACTION_TYPES.SYNC_TAG_CHANNEL}`)
nextTick(() => {
channelForm.value?.focus()
setTimeout(() => {
channelForm.value?.focus()
}, 500)
})
})
onBeforeUnmount(() => {
Expand Down
10 changes: 6 additions & 4 deletions src/renderer/components/TimelineSpace/Modals/NewToot/Status.vue
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,12 @@ export default defineComponent({
})
onMounted(() => {
nextTick(() => {
statusRef.value?.focus()
if (fixCursorPos.value) {
statusRef.value?.setSelectionRange(0, 0)
}
setTimeout(() => {
statusRef.value?.focus()
if (fixCursorPos.value) {
statusRef.value?.setSelectionRange(0, 0)
}
}, 500)
})
})
Expand Down

0 comments on commit 74ed5fd

Please sign in to comment.