Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -122,14 +122,18 @@ def render_message(history):
|
|
| 122 |
messages_html += """
|
| 123 |
</div>
|
| 124 |
</div>
|
| 125 |
-
|
| 126 |
function scrollToBottom() {
|
| 127 |
var chatbox = document.getElementById('chatbox-container');
|
| 128 |
-
|
|
|
|
|
|
|
| 129 |
}
|
|
|
|
| 130 |
window.onload = function() {
|
| 131 |
scrollToBottom();
|
| 132 |
};
|
|
|
|
| 133 |
setTimeout(scrollToBottom, 0);
|
| 134 |
</script>
|
| 135 |
"""
|
|
|
|
| 122 |
messages_html += """
|
| 123 |
</div>
|
| 124 |
</div>
|
| 125 |
+
<script>
|
| 126 |
function scrollToBottom() {
|
| 127 |
var chatbox = document.getElementById('chatbox-container');
|
| 128 |
+
requestAnimationFrame(function() {
|
| 129 |
+
chatbox.scrollTop = chatbox.scrollHeight;
|
| 130 |
+
});
|
| 131 |
}
|
| 132 |
+
|
| 133 |
window.onload = function() {
|
| 134 |
scrollToBottom();
|
| 135 |
};
|
| 136 |
+
|
| 137 |
setTimeout(scrollToBottom, 0);
|
| 138 |
</script>
|
| 139 |
"""
|