Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -125,16 +125,17 @@ def render_message(history):
|
|
| 125 |
<script>
|
| 126 |
function scrollToBottom() {
|
| 127 |
var chatbox = document.getElementById('chatbox-container');
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
|
|
|
| 131 |
}
|
| 132 |
|
| 133 |
window.onload = function() {
|
| 134 |
scrollToBottom();
|
| 135 |
};
|
| 136 |
|
| 137 |
-
setTimeout(scrollToBottom,
|
| 138 |
</script>
|
| 139 |
"""
|
| 140 |
|
|
|
|
| 125 |
<script>
|
| 126 |
function scrollToBottom() {
|
| 127 |
var chatbox = document.getElementById('chatbox-container');
|
| 128 |
+
var messages = document.getElementById('messages'); // Target the messages div
|
| 129 |
+
setTimeout(function() { // Delay to ensure content is fully loaded
|
| 130 |
+
chatbox.scrollTop = messages.scrollHeight; // Scroll to the bottom of messages div
|
| 131 |
+
}, 100); // Delay adjusted for proper loading
|
| 132 |
}
|
| 133 |
|
| 134 |
window.onload = function() {
|
| 135 |
scrollToBottom();
|
| 136 |
};
|
| 137 |
|
| 138 |
+
setTimeout(scrollToBottom, 100);
|
| 139 |
</script>
|
| 140 |
"""
|
| 141 |
|