Am I right in assuming callbacks do not work for custom components in @st.experimental_dialog? - Callbacks broken in custom components

Something as simple as this code does not execute:

if "test_text" not in st.session_state:
    st.session_state["test_text"] = None 

@st.experimental_dialog(title="Test", width="small")
def test_dialog():

    import streamlit_antd_components as sac

    def onChangeTest():

        st.session_state["test_text"] = st.session_state["testing123"] 
    

    sac.chip(
        items=[
            sac.ChipItem(label='apple'),
            sac.ChipItem(label='google'),
            sac.ChipItem(label='github', icon='github'),
            sac.ChipItem(label='twitter', icon='twitter'),
        ], label='label', index=0, align='center', radius='md', multiple=False, key="testing123", on_change=onChangeTest
    )
    st.write(st.session_state["test_text"])

st.button("Test", key="test_btn")

if st.session_state["test_btn"]:
    test_dialog()


But it works with native widgets:

if "test_text" not in st.session_state:
    st.session_state["test_text"] = None 

@st.experimental_dialog(title="Test", width="small")
def test_dialog():

    import streamlit_antd_components as sac

    def onChangeTest():

       st.session_state["test_text"] = st.session_state["testing123"] 
    
       st.radio("dummy label", ["one", "two", "three", "four"], key="testing123", on_change=onChangeTest )

   
       st.write(st.session_state["test_text"])


st.button("Test", key="test_btn")

if st.session_state["test_btn"]:
    test_dialog()

UPDATE
It seems to be connected to this post wherein callbacks for custom components seem to be broken in the latest update. And it seems to be affecting other custom components like the popular streamlit-option-menu here.

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