-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Description
I am wondering how I could reset state of the editor. I found that I could set initial text with value key but updating it later does not seem to change anything. Here is my attempt
import streamlit as st
from streamlit_ace import st_ace
LANGUAGE = "yaml"
THEME = "twilight"
if 'manifest' not in st.session_state:
st.session_state.manifest = ""
reset = st.button("Reset!")
if reset:
st.session_state.manifest = ""
print(st.session_state.manifest == "")
content = st_ace(
value=st.session_state.manifest,
placeholder="# Paste your manifest here",
language=LANGUAGE,
theme=THEME,
font_size=14,
tab_size=4,
min_lines=45,
auto_update=True,
key="ace",
)
if content:
st.session_state.manifest = content
st.subheader("Content")
st.code(content, language=LANGUAGE)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels