Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

on_change callback as seen in st.text_area #27

Copy link
Copy link

Description

@Krastanov
Issue body actions

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.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.