-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
widget.empty() clears the widget only at the end of the script #2395
Comments
Streamlit snippets of the code example: https://share.streamlit.io/akrolsmir/streamlit-snippet/main?snippet_id=FcAXRYMC |
Hi ! Sorry for the bump. Could you tell me if it's considered as a bug and worth fixing ? Thanks |
Hi & Happy new year ! :) Another bump to understand if it's considered as a bug and worth fixing ? Thanks |
Hi! Sorry for the delay in getting back to you @Wirg, but yes this is certainly something that we're looking into fixing. I'm actually just starting to see if I can polish the behavior of |
\streamlit#2395 ended up being caused by this since we don't rerender placeholder components created by `st.empty()` when react props/state change as a performance optimization, but we need to do so when replacing an existing component with an empty one to get rid of what's currently drawn on screen. Closes streamlit#2395
\#2395 ended up being caused by this since we don't rerender placeholder components created by `st.empty()` when react props/state change as a performance optimization, but we need to do so when replacing an existing component with an empty one to get rid of what's currently drawn on screen. Closes #2395
\streamlit#2395 ended up being caused by this since we don't rerender placeholder components created by `st.empty()` when react props/state change as a performance optimization, but we need to do so when replacing an existing component with an empty one to get rid of what's currently drawn on screen. Closes streamlit#2395
* switched react-katex package * lockfile updated * update test to corrected spelling * decapitalize KaTex * Fix slider UX (#2596) * Fix slider UX * Add snapshot * Revert "Deploy button front (#2552)" (#2599) * Revert "Deploy button front (#2552)" This reverts commit 0f66b6e. * Fix merge (erm... revert) conflict. * Revert "Deploy button py (#2535)" This reverts commit 0bbc7aa. Co-authored-by: karrie <karrie@streamlit.io> * Remove extra period from sentence (#2601) * Have st.number_input warn user of mismatched type and format string (#2604) * Add %u to list of valid number_input formatters * Have number_input warn user of mismatched type and format string * Use more modern f-string syntax instead of .format() * Feature/sudoless metrics (#2605) * Add and use sudoless machine id getter for metrics Step 2 of the metrics user ID improvement plan. * Add machine-id v3 tests Duplicates of the v1 tests, since those covered the cases that remain in v3, and we will remove v1 and its tests later. Also fix formatting of some python files. * DRY out machine ID paths into global constants * Increase side padding to 5rem when app is in wide mode (#2613) * Increase side padding to 5rem when app is in wide mode * Upload Cypress snapshot * Rerender Maybe components when they're first disabled (#2617) \#2395 ended up being caused by this since we don't rerender placeholder components created by `st.empty()` when react props/state change as a performance optimization, but we need to do so when replacing an existing component with an empty one to get rid of what's currently drawn on screen. Closes #2395 Co-authored-by: karrie <karrie@streamlit.io> Co-authored-by: Thiago Teixeira <thiago@streamlit.io> Co-authored-by: Randy Zwitch <randy@streamlit.io> Co-authored-by: Vincent Donato <vincent.rdonato@gmail.com> Co-authored-by: Amanda Walker <amanda@amandawalker.io> Co-authored-by: Austin Chen <akrolsmir@gmail.com> Co-authored-by: Vincent Donato <vincent@streamlit.io>
Any update on this thread? |
Hi and thank you for streamlit :)
Summary
Using
widget.empty()
on a widget, empty the widget but only when streamlit reach the end of the script.Steps to reproduce
Expected behavior:
I expect
widget.empty()
to empty the widget "instantly" when I call the function.write
,progress
and other widgets already work this way (here beforest.write("cleared original text")
).Actual behavior:
The widget is emptied when streamlit reaches the end of the script (here, after
st.text("end")
).Is this a regression?
I don't know.
Debug info
The text was updated successfully, but these errors were encountered: