RomZay commited on
Commit
6375f48
·
verified ·
1 Parent(s): aac3a13

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -125,16 +125,17 @@ def render_message(history):
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
  """
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