-
-
Notifications
You must be signed in to change notification settings - Fork 16
Description
Currently, if one needs to get the content of code editor as set by the user, modify it with some internal logic, and then return it in the same code editor, one has to rely on st.rerun() and manual state tracking.
However, many streamlit elements, like text_area provide on_change callbacks. Instead of checking the code_editor_dict and issuing a rerun, one simply registers a callback that is executed on a submit press.
Is such a feature possible for streamlit-code-editor?
This issue is superficially related to #12 but the solution shown there is not providing a callback, only an automated rerun.
Note: text_area's on_change is a misnomer -- it is more of an on_submit. It follows these semantics: https://docs.streamlit.io/develop/api-reference/caching-and-state/st.session_state#use-callbacks-to-update-session-state
The reason I am asking for this is that it will make it possible to change the session state after a submit but before a new render of the code editor.