Hi @castoldie , Welcome to the Streamlit Community Forum !
Thank you for sharing the app here, it’s really a nice app and wish you guys the best!
Best possible guess would be, since Streamlit runs linearly from the very top, the app reruns and therefore all your stats disappears, unless you click the search button again.
- An easy (not ideal) quick fix would be, to change your submit button to a checkbox
st.checkbox. Which will maintain the checked ‘ON’ state for the app.
- Other possible workaround can be, to control the state of the search button using SessionState, [
- Otherwise, wrapping up the computing part of your code, within a single function may do the trick with usage of
st.cache syntax. Do refer to the doc.
The above workarounds may not be valid, if it’s not the case within your app. You can always share the link of your code or link of your repo, if it’s fine for you to be public.
Let me know.