Skip to content

Commit

Permalink
fix: edge case where terminal wouldnt scroll to bottom
Browse files Browse the repository at this point in the history
Signed-off-by: Evan Song <theevansong@gmail.com>
  • Loading branch information
ferothefox committed Oct 20, 2024
1 parent 83952fc commit 843758d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion apps/frontend/src/components/ui/servers/PanelTerminal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,12 @@ const scrollToBottom = () => {
}
};
const debouncedScrollToBottom = () => {
requestAnimationFrame(() => {
setTimeout(scrollToBottom, 0);
});
};
const enterFullScreen = () => {
isFullScreen.value = true;
document.body.style.overflow = "hidden";
Expand Down Expand Up @@ -330,7 +336,7 @@ watch(
nextTick(() => {
updateItemHeights();
if (!userHasScrolled.value || isScrolledToBottom.value) {
scrollToBottom();
debouncedScrollToBottom();
}
});
},
Expand Down

0 comments on commit 843758d

Please sign in to comment.