georad commited on
Commit
7ca0dd0
·
verified ·
1 Parent(s): 2e58075

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -5
app.py CHANGED
@@ -38,13 +38,18 @@ pg = st.navigation({"Home": [home_page], "Demo": [type_text_page, upload_file_pa
38
 
39
  pg.run()
40
 
41
- # JavaScript to scroll to the bottom
 
 
 
42
  scroll_script = """
43
  <script>
44
- var body = window.parent.document.querySelector(".main");
45
- if (body) {
46
- body.scrollTop = body.scrollHeight;
47
- }
 
 
48
  </script>
49
  """
50
 
 
38
 
39
  pg.run()
40
 
41
+ # Add a dummy element at the bottom
42
+ st.markdown('<div id="bottom"></div>', unsafe_allow_html=True)
43
+
44
+ # JavaScript to scroll the dummy element into view
45
  scroll_script = """
46
  <script>
47
+ document.addEventListener('DOMContentLoaded', function() {
48
+ const bottomElement = window.parent.document.getElementById('bottom');
49
+ if (bottomElement) {
50
+ bottomElement.scrollIntoView({ behavior: 'smooth', block: 'end' });
51
+ }
52
+ });
53
  </script>
54
  """
55