Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -55,20 +55,20 @@ st.set_page_config(
|
|
55 |
initial_sidebar_state="expanded" # Keep sidebar expanded by default
|
56 |
)
|
57 |
|
58 |
-
#
|
59 |
-
|
60 |
-
<
|
61 |
-
|
62 |
-
.sidebar .sidebar-content
|
63 |
-
position
|
64 |
-
|
65 |
-
|
66 |
-
}
|
67 |
-
</
|
68 |
"""
|
69 |
|
70 |
-
# Apply the
|
71 |
-
st.markdown(
|
72 |
|
73 |
# CSS styles for light and dark modes
|
74 |
universal_text_color_css = """
|
|
|
55 |
initial_sidebar_state="expanded" # Keep sidebar expanded by default
|
56 |
)
|
57 |
|
58 |
+
# JavaScript to prevent scrolling in the sidebar but allow scrolling within
|
59 |
+
prevent_sidebar_scroll_js = """
|
60 |
+
<script>
|
61 |
+
document.addEventListener('DOMContentLoaded', function() {
|
62 |
+
const sidebarContent = document.querySelector('.sidebar .sidebar-content');
|
63 |
+
sidebarContent.style.position = 'sticky';
|
64 |
+
sidebarContent.style.top = '0';
|
65 |
+
sidebarContent.style.overflowY = 'auto';
|
66 |
+
});
|
67 |
+
</script>
|
68 |
"""
|
69 |
|
70 |
+
# Apply the JavaScript
|
71 |
+
st.markdown(prevent_sidebar_scroll_js, unsafe_allow_html=True)
|
72 |
|
73 |
# CSS styles for light and dark modes
|
74 |
universal_text_color_css = """
|