Fixed scrolling on overflow

This commit is contained in:
ForeverPyrite
2025-01-07 16:57:44 -05:00
parent 5a09efd5b0
commit b33a2a3bd7
3 changed files with 4 additions and 3 deletions

View File

@@ -12,7 +12,7 @@
<body> <body>
<main class="container"> <main class="container">
<section class="response-section"> <section id="response-section">
<pre id="response-area">Response will appear here.</pre> <pre id="response-area">Response will appear here.</pre>
</section> </section>

View File

@@ -1,5 +1,6 @@
document.addEventListener("DOMContentLoaded", () => { document.addEventListener("DOMContentLoaded", () => {
const responseArea = document.getElementById('response-area'); const responseArea = document.getElementById('response-area');
const responseSection = document.getElementById('response-section');
const submitButton = document.getElementById('submit'); const submitButton = document.getElementById('submit');
const urlForm = document.getElementById('url-form'); const urlForm = document.getElementById('url-form');
const urlBox = document.getElementById('url_box'); const urlBox = document.getElementById('url_box');
@@ -67,7 +68,7 @@ document.addEventListener("DOMContentLoaded", () => {
} }
const chunk = decoder.decode(value, { stream: true }); const chunk = decoder.decode(value, { stream: true });
responseArea.innerHTML += chunk; responseArea.innerHTML += chunk;
responseArea.scrollTop = responseArea.scrollHeight; responseSection.scrollTop = responseSection.scrollHeight
readStream(); readStream();
}).catch(error => { }).catch(error => {
console.error('Error reading stream:', error); console.error('Error reading stream:', error);

View File

@@ -33,7 +33,7 @@ body {
overflow: hidden; overflow: hidden;
} }
.response-section { #response-section {
flex: 1; flex: 1;
padding: 20px; padding: 20px;
background-color: #1E1E1E; background-color: #1E1E1E;