One week back started using Streamlit. The docs are self-understandable and helped to quickly go prepare an app for my project. However, I ran into one critical issue as follows:
My app is consists of:
- Two radio buttons on the sidebar
- Based on these selections, a different number of checkboxes, sliders, and dropdown appears on the main page.
While changing the radio buttons selections, I receive the error:
IndexError: list index out of range
After debugging, I came to know this issue is because in st.session_state the earlier widgets are still present i.e. two checkboxes to be true, etc. My expectation here is that when a change of selection from radio button is noticed by app during rerun, all the widgets should be deleted or reset because the number of widgets and their values/names will change.