I recently upgraded my streamlit version from v1.24 to v1.25.
I just noticed an undesired behavior with expanders:
I have several expanders on my page that are collapsed by default. The user can interact with any of them with various inputs and buttons (this modifies a dataframe that is displayed under various forms inside the other expanders).
The problem is, with this new version of streamlit, any click causes the other expanders to close. I downgraded streamlit and the problem was gone.
Any help on this would be appreciated
- Streamlit version: 1.25.0
- Python version: 3.9.16
Hi @mlbc and welcome to our forums!
Thanks for reporting this. This indeed sounds like a possible bug!
I’ll liaise with the devs to find out and will keep you posted.
Thanks for your patience.
@mlbc - Would you be able to provide some more specific repro code and steps, please?
Actually, I tried to produce a minimal code but didn’t succeed in reproducing the exact same bug I have in my page . I think that the problem comes from the way it is coded, using a child “page” class inherited from a base class, and session states (for storing the dataframe)
After investigation the problem isn’t exactly with expanders.
- Problem comes from v1.24.0. Downgrading to 1.23 or upgrading to 1.25 solves it.
- Any click or action causes the whole page to refresh. Which means in particular that expanders on the side will come back to their default state (collapsed).
I’m sorry I can’t provide more information. If I manage to produce more detailed code, I’ll update this post.