Wanswan commited on
Commit
e734bfe
·
verified ·
1 Parent(s): 9a9950f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -215,7 +215,9 @@ footer, .icon-button-wrapper, label.svelte-1to105q {
215
  const chatbox = document.getElementById("chatbox");
216
  if (chatbox) {
217
  const observer = new MutationObserver(() => {
218
- chatbox.scrollTop = chatbox.scrollHeight;
 
 
219
  });
220
  observer.observe(chatbox, { childList: true, subtree: true });
221
  } else {
@@ -224,6 +226,7 @@ footer, .icon-button-wrapper, label.svelte-1to105q {
224
  };
225
  waitForChatbox();
226
  </script>
 
227
  """)
228
 
229
  chatbot = gr.Chatbot(
 
215
  const chatbox = document.getElementById("chatbox");
216
  if (chatbox) {
217
  const observer = new MutationObserver(() => {
218
+ requestAnimationFrame(() => {
219
+ chatbox.scrollTop = chatbox.scrollHeight + 150; // 加偏移量
220
+ });
221
  });
222
  observer.observe(chatbox, { childList: true, subtree: true });
223
  } else {
 
226
  };
227
  waitForChatbox();
228
  </script>
229
+
230
  """)
231
 
232
  chatbot = gr.Chatbot(