STreamlit goes into long running mode as soon as a button is pressed

In this code, as soon as I press the key streamlit goes into a 2 min RUNNING mode and --debug does not show what is being done during that running mode,

            if st.button(element, key=unique_key):
                #st.session_state.clicked_button = element
                st.write(f' You clicked: {element}')
                seconds = self.timestamp_to_seconds(str(element))
                self.update_start_time(seconds)

Have tried many many things that ChatGpt suggested none worked

The matter is nicely resolved when using @st.fragment on top of the module; there is no trace of this solution in AI knowledge, even chatgpt cannot recommend the right syntax for st.fragment :st.fragment - Streamlit Docs

1 Like