Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
Properly focus input and scroll to the end when loading DebugConsoleP…
Browse files Browse the repository at this point in the history
…age.
  • Loading branch information
sproxet committed Aug 27, 2021
1 parent 74136db commit 21c8b9e
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/renderer/components/DebugConsolePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ export default {
},
async mounted () {
this.focusInput();
// This is needed when we're reloading the page.
while (!window.$daemon) {
await new Promise(r => setTimeout(r, 10));
Expand All @@ -144,13 +142,9 @@ export default {
this.availableCommands = sort_dedup(commands.concat(Object.keys(this.clientCommands)));
},
beforeRouteEnter(_to, _from, next) {
// This is called after the component is loaded. It can't be placed in mounted() because mounted() won't be
// called when the user returns to this screen since we use <keep-alive> in MainLayout.vue.
next(self => {
self.scrollToBottom();
self.focusInput();
});
async activated() {
this.scrollToBottom();
this.focusInput();
},
methods: {
Expand Down

0 comments on commit 21c8b9e

Please sign in to comment.