streamlit-navigation-bar
streamlit-navigation-bar copied to clipboard
Unwanted rerendering of the page when interacting with input widgets
Checklist
- [X] I have searched the existing issues for similar issues.
- [X] I added a very descriptive title to this issue.
- [X] I have provided sufficient information below to help reproduce this issue.
Summary
When interacting with input widgets one can observe very briefly a rerendering of the page. It doesn't appear systematically, but enough to be annoying.
Reproducible code example
import streamlit as st
def show_home():
st.header("Home")
st.write(
"""
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam pharetra
facilisis mauris, vel consequat odio. Nam pretium neque id sem malesuada
ornare. Morbi id ex pulvinar dui placerat congue. Suspendisse ultricies, lacus
eget porttitor blandit, enim nisi tincidunt eros, nec varius tortor turpis et
tortor.
Curabitur facilisis, augue eu eleifend dictum, quam lectus ullamcorper tellus,
auctor mollis lacus turpis id tellus. Mauris consectetur eleifend dignissim.
Integer nulla arcu, fringilla quis finibus vel, iaculis ac massa. Cras at
mauris a magna blandit mattis. Nam vel turpis et risus tempus congue ac quis
lectus. Pellentesque id laoreet ex, sit amet consequat leo. Aenean commodo
luctus tristique. Curabitur arcu urna, tempus ut lectus et, pulvinar lobortis
urna.
"""
)
xx = st.button("CLICK HERE", key="b1")
col1, col2, col3, col4 = st.columns(4)
with col1:
a = st.number_input("NUMBER INPUT", value=0, step=1, key="ni1")
with col2:
b = st.number_input("NUMBER INPUT", value=0, step=1, key="ni2")
with col3:
c = st.number_input("NUMBER INPUT", value=0, step=1, key="ni3")
with col4:
d = st.number_input("NUMBER INPUT", value=0, step=1, key="ni4")
Steps to reproduce
Try clicking several times either on the button "CLICK HERE" or the +/- signs from the number input widgets. You might then observe a very quick rerendering occuring.
Expected behavior
I expect the page to be static at all times when I am in the same tab from the navigation bar.
Current behavior
I observe a quick rerendering when I am interacting with input widgets.
Is this a regression?
I did not test it with earlier versions.
Debug info
- Streamlit version: 1.37.0
- Streamlit Navigation Bar version: 3.3.0
- Python version: 3.10.14
- Operating System: macOS Monterey Version 12.4
- Browser: Chrome, Brave
Additional information
Unfortunately, the screencast was recorded at a lower FPS - hence not all rerenderings were catched - but you will be able to visualize the probem for the last widget although it was also present on the other ones.
https://github.com/user-attachments/assets/7c51768e-b24c-490f-9dd7-8e4c0cbd104c