georad commited on
Commit
203b2d8
·
verified ·
1 Parent(s): 6657253

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -1
app.py CHANGED
@@ -55,4 +55,21 @@ st.sidebar.text("Demo by JA-RAD (work in progress)")
55
  pg = st.navigation(pages=[type_text_page]) # WITHOUT SECTIONS
56
  ##pg = st.navigation({"Chapter_Index": [start_page], "Demo": [type_text_page, upload_file_page], "About": [about_page]}) # WITH SECTIONS
57
  pg.run()
58
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  pg = st.navigation(pages=[type_text_page]) # WITHOUT SECTIONS
56
  ##pg = st.navigation({"Chapter_Index": [start_page], "Demo": [type_text_page, upload_file_page], "About": [about_page]}) # WITH SECTIONS
57
  pg.run()
58
+
59
+ # Add a dummy element at the bottom
60
+ st.markdown('<div id="bottom"></div>', unsafe_allow_html=True)
61
+
62
+ # JavaScript to scroll the dummy element into view
63
+ scroll_script = """
64
+ <script>
65
+ document.addEventListener('DOMContentLoaded', function() {
66
+ const bottomElement = window.parent.document.getElementById('bottom');
67
+ if (bottomElement) {
68
+ bottomElement.scrollIntoView({ behavior: 'smooth', block: 'end' });
69
+ }
70
+ });
71
+ </script>
72
+ """
73
+
74
+ # Inject the script
75
+ components.html(scroll_script, height=0, width=0)