Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -148,6 +148,19 @@ with gr.Blocks(css=".chatbox {height: 400px; overflow-y: auto; border: 1px solid
|
|
| 148 |
}
|
| 149 |
|
| 150 |
</style>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 151 |
""")
|
| 152 |
|
| 153 |
if __name__ == "__main__":
|
|
|
|
| 148 |
}
|
| 149 |
|
| 150 |
</style>
|
| 151 |
+
<script>
|
| 152 |
+
const chatbox = document.getElementById('chatbox');
|
| 153 |
+
|
| 154 |
+
function scrollToBottom() {
|
| 155 |
+
chatbox.scrollTop = chatbox.scrollHeight;
|
| 156 |
+
}
|
| 157 |
+
|
| 158 |
+
function handleNewMessage() {
|
| 159 |
+
setTimeout(scrollToBottom, 50);
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
window.addEventListener('message', handleNewMessage);
|
| 163 |
+
</script>
|
| 164 |
""")
|
| 165 |
|
| 166 |
if __name__ == "__main__":
|