Fixed scrolling on overflow
This commit is contained in:
@@ -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>
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user