Before clicking “Create Topic”, please make sure your post includes the following information (otherwise, the post will be locked). 
- Are you running your app locally or is it deployed?
—> locally - If your app is deployed:
a. Is it deployed on Community Cloud or another hosting platform?
b. Share the link to the public deployed app. - Share the link to your app’s public GitHub repository (including a requirements file).
- Share the full text of the error message (not a screenshot).
- Share the Streamlit and Python versions.
python == 3.10.12
streamlit == 1.27.2
hello everyone.
I created code that, when I click a button, creates 20 expanders containing radio buttons.
It ran normally, but
If I select the radio button belonging to any expander,
All 20 expanders created will disappear.
but selectChoice method called successful in my code.
What could be the problem? Below is the code I wrote.
import streamlit as st
def selectChange(index):
choice = st.session_state[‘exp%s’%index]
print(index, choice)
if st.button("Make 20 Expander"):
for i in range(20):
exp = st.expander('Custom radio button VS Native radio button %s'%i)
exp.header('Custom radio button')
custom_choice = exp.radio(
label='pick one',
options=['option 1', 'option 2', 'option 3'],
index=None,
key="exp%s"%i,
on_change=selectChage, arts=(i,)
)