Any click on page causes all expanders to close with streamlit v1.24.0

Summary

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 :pray:

Debug info

  • Streamlit version: 1.25.0
  • Python version: 3.9.16

Hi @mlbc and welcome to our forums! :raised_hands:

Thanks for reporting this. This indeed sounds like a possible bug! :bug:

Iโ€™ll liaise with the devs to find out and will keep you posted.

Thanks for your patience.

Charly

@mlbc - Would you be able to provide some more specific repro code and steps, please?

Thanks,
Charly

1 Like

Thanks Charly.
Actually, I tried to produce a minimal code but didnโ€™t succeed in reproducing the exact same bug I have in my page :sweat_smile:. 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.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.