Closed Socvest closed 6 months ago
If this issue affects you, please react with a 👍 (thumbs up emoji) to the initial post.
Your feedback helps us prioritize which bugs to investigate and address first.
Hey @Socvest , thank you for opening this issue!
In general, we don't have an official way to support callbacks on custom components (https://github.com/streamlit/streamlit/issues/3977), but it looks like the latest release broke some workarounds that worked previously (https://github.com/victoryhb/streamlit-option-menu/issues/70). (I saw your comment under the last issue.)
@raethlein could have more information about this, but as far as I understood, this particular case doesn't connect with st.experimental_dialog
behavior.
Hey @kajarenc thanks for getting back to me. Yeah, I did further investigations and its more related to the callback work arounds for custom components than st.experimental_dialog.
Hey @Socvest, the internal package structure has changed due to a refactoring; if you change the import in the streamlit_callback.py
to from streamlit.components.v1 import custom_component as _components
, it should work again. If you are not the author of sac
, this might be something to bring to them.
That being written, this is not an official API we are going to guarantee from Streamlit-side 😉 However, we will look into this more closely and try to come up with a clean API for the future so that this patch is not needed anymore. In the meantime, I hope this^ unblocks you (for now).
Thank you! Appreciate this very much guys, thanks!
Checklist
Summary
In attempt to create a dynamic filter in a dialog box, I stumbled on the fact updating a session_state variable via a custom component is not possible.
Reproducible Code Example
But it works with native widgets: