#17011·streamlit

Conditionally created dialog in a fragment stops logically existing after rerun of a fragment while still existing on the website

Author: KiryumeCreated Sep 17, 2026Updated Sep 17, 2026
Labelstype:bugtype:regressionstatus:confirmedpriority:P2feature:st.dialogfeature:st.fragmentarea:execution-model

Checklist

  • I have searched the existing issues for similar issues.
  • I added a very descriptive title to this issue.
  • I have provided sufficient information below to help reproduce this issue.

Summary

When a fragment gets rerun and it has conditionally rendered child dialog (for example guarded by a button being clicked) the dialog will stop being responsive while still existing on the page

Reproducible Code Example

python
import streamlit as st


@st.dialog("Dialog", dismissible=False)
def show_dialog() -> None:
    if st.button("Increment"):
        st.session_state["clicks"] = st.session_state.get("clicks", 0) + 1
    st.write("Clicks:", st.session_state.get("clicks", 0))


@st.fragment(run_every=5)
def parent_fragment() -> None:
    st.session_state["parent_runs"] = st.session_state.get("parent_runs", 0) + 1
    st.write("Parent runs:", st.session_state["parent_runs"])
    if st.button("Open dialog"):
        show_dialog()


st.write("Open the dialog, then wait for the parent fragment's next automatic rerun (every 5 seconds).")
parent_fragment()

Steps To Reproduce

  1. Click Open dialog
  2. start clicking increment
  3. after parent reruns the dialog stops being responsive and streamlit will log The fragment with id does not exist anymore - it might have been removed during a preceding full-app rerun.

Expected Behavior

The dialog to still be responsive

Current Behavior

The dialog stops being responsive

Is this a regression?

  • Yes, this used to work in a previous version.

Debug info

  • Streamlit version: 1.64.0
  • Python version: Python 3.13.13
  • Operating System: Linux 7.1.4-arch1-1
  • Browser: Firefox

Additional Information

worked when ran with

uv run --no-project --with streamlit==1.57.0 streamlit run repro.py

stopped working at

uv run --no-project --with streamlit==1.58.0 streamlit run repro.py