Expander expanded=False not working

two buttons.
one expander in each button.
both expanders are collapsed by default.

expanding one expander under one button automatically leads to another expander expanding.

Am I missing something here or is this a bug?

here’s the live demo
Streamlit

import streamlit as st

b0 = st.button("b0")
b1 = st.button("b1")

if b0:
    with st.expander("b0_expander", expanded=False):
        st.write("b0_write")

if b1:
    with st.expander("b1_expander", expanded=False):
        st.write("b1_write")

maybe something related:

clearing cache doesn’t help

Hey @kimehta,

First, welcome to the Stereamlit community! :partying_face: :partying_face: :tada: :parachute:

Thanks so much for your detailed explanation and especially for the super helpful app and the exact steps to reproduce what you’re seeing. The same thing happens when I try and I have sent this onto the team to check out!

I will let you know once I hear more from them!

Happy Streamlit-ing!
Marisa

Hey @kimehta,

The team was able to reproduce this and we have created an issue that you can follow on GitHub as we fix this bug! :bug:

Happy Streamlit-ing!
Marisa

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