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

Don't rerun on widget interaction #5827

Open
jrieke opened this issue Dec 7, 2022 · 8 comments
Open

Don't rerun on widget interaction #5827

jrieke opened this issue Dec 7, 2022 · 8 comments
Labels
area:events area:widgets type:enhancement Requests for feature enhancements or new features

Comments

@jrieke
Copy link
Collaborator

jrieke commented Dec 7, 2022

When a user interacts with a widget, Streamlit always reruns the entire script. There are ways to get around this (forms, caching, ...) but sometimes it would be really useful to just do something like st.slider(..., rerun=False).

See requests in this very popular forum post: https://discuss.streamlit.io/t/how-to-prevent-the-reloading-of-the-whole-page-when-i-let-the-user-to-perform-an-action/10800/7

This touches on the fundamental of Streamlit so we'll need to think this through carefully. No guarantees that we'll do this anytime soon! If you have use cases, please post them here (and upvote the issue!) so we can prioritize and see what's the best way to solve all problems.


Community voting on feature requests enables the Streamlit team to understand which features are most important to our users.

If you'd like the Streamlit team to prioritize this feature request, please use the 👍 (thumbs up emoji) reaction in response to the initial post.

@jrieke jrieke added the type:enhancement Requests for feature enhancements or new features label Dec 7, 2022
@cmayoracurzio
Copy link

Not 100% sure, but it seems a hypothetical "rerun" argument in widgets might overlap with the behavior of the "key" argument that already exists (which controls when widgets are reset).

@juancamilog
Copy link

An use case where this would be useful is a combination of a selectable dataframe (using streamlit aggrid) and an image gallery. The user would select which rows to display from the aggrid table.

The problem with the current streamlit design is that when the user selects a row in the table, all of the previously rendered images (from previous row selections) will be re-loaded. It's not a porblem when you select 2 or 3 rows, but it becomes a problem when you select more than 10-20 rows.

@timothylimyl
Copy link

current roadblock that led me to this issue was:

  • Trying to setup a feedback form for users
  • Upon submission of feedback form (either by st.button or st.form..button), the page reloads and clears everything.
  • Tried st.forms, thought it would work but due to the nature of streamlit, it will force a reload of the script upon submission and clear everything

Expectation is:

  • Upon submission of feedback form, only the form clears but everything else is remain outputted on the page.
  • If user want to provide another feedback, the user can still look at the app output and submit another feedback.

@NLPBrewer
Copy link

@yash2mehta
Copy link

Pulled my hair out trying to implement this. Plsss implement this. Love streamlit but this is detering me away

@rtayeb
Copy link

rtayeb commented Nov 1, 2023

OK. This might be asking too much, but I am going to ask it anyway. In multi page setup I wish there was an option to freeze the pages and when navigating in between the pages you can maintain the data, results and values they are displaying. Most of my applications involve loading a large panda dataframe in a dashboard type page with lots of calculations. I wish I did not have to start fresh loading data and doing calculations all over again. I guess this requires streamlit to save the current state of the page completely and return it to the user when he/she goes back to the original page. This feature makes streamlit behave more like a regular application and, in my opinion, makes it more practical.  OK I said it knowing that it has zero chance to be implemented. Regardless, I am very thankful to streamlit team for their great work. Keep up the good work and have a wonderful night

@rychardbarros
Copy link

It would be a very useful feature, especially when it is necessary to generate just one specific component without the need for a rerun.

@ChrisDelClea
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:events area:widgets type:enhancement Requests for feature enhancements or new features
Projects
None yet
Development

No branches or pull requests

10 participants