Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unwanted rerendering of the page when interacting with input widgets #21

Open
3 tasks done
joelmfonseca opened this issue Aug 4, 2024 · 0 comments
Open
3 tasks done
Labels
bug Something isn't working

Comments

@joelmfonseca
Copy link

joelmfonseca commented Aug 4, 2024

Checklist

  • I have searched the existing issues for similar issues.
  • I added a very descriptive title to this issue.
  • 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.

screencast.mov
@joelmfonseca joelmfonseca added the bug Something isn't working label Aug 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant